Shebang missing in dist/cli.mjs in published package
TomOne opened this issue · comments
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
- Run
npm install google-font-metadata
in a Node.js project. - Run
npx gfm
- 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
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.
Thank you for the info and for looking into this.
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.
That's great. Thank you very much. 👍