Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shebang missing in dist/cli.mjs in published package #120

Closed
TomOne opened this issue Apr 5, 2023 · 5 comments · Fixed by #121
Closed

Shebang missing in dist/cli.mjs in published package #120

TomOne opened this issue Apr 5, 2023 · 5 comments · Fixed by #121
Labels
bug Something isn't working

Comments

@TomOne
Copy link

TomOne commented Apr 5, 2023

Describe the bug

The file dist/cli.mjs in the published package does not contain a shebang line (#!/usr/bin/env node). This causes the npx gfm … command to fail with the following error:

/home/user/code/project/node_modules/.bin/gfm: 23: Syntax error: "(" unexpected

I cloned this project locally, ran npm install and after building, the dist dist/cli.mjs included the shebang:

#!/usr/bin/env node
import 'dotenv/config';
import { cac } from 'cac';
import consola from 'consola';
import colors from 'picocolors';
// …

That’s odd. Maybe something has gone wrong while building the published version. This issue is probably Linux/macOS only (because without a shebang, the file is interpreted as a shell script instead of JS, which causes this syntax parsing error).

Steps to Reproduce

  1. Run npm install google-font-metadata in a Node.js project.
  2. Run npx gfm
  3. See the error or see it hanging.

Expected behavior

The npx gfm … command should run without an error.

Version

5.0.1

OS

Linux

Browser

No response

Additional context

No response

@TomOne TomOne added the bug Something isn't working label Apr 5, 2023
@ayuhito
Copy link
Member

ayuhito commented Apr 5, 2023

Related privatenumber/pkgroll#10.

I did generate the last version on a Windows machine… perhaps the hashbang isn’t included when built on that OS as a weird edge case. I’ll look into publishing a fixed version soon.

@TomOne
Copy link
Author

TomOne commented Apr 6, 2023

Thank you for the info and for looking into this.

@ayuhito
Copy link
Member

ayuhito commented Apr 26, 2023

Sorry for the delay, I'll release a new version really soon (hopefully tomorrow or the day after). Google introduced icons into the API without distinguishing them as unique 😔 That has broken the parser for the time being, but I have a fix half done.

@ayuhito
Copy link
Member

ayuhito commented Apr 28, 2023

Released in v5.1.0 🎉

@TomOne
Copy link
Author

TomOne commented May 2, 2023

That's great. Thank you very much. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants