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

CLI error This: command not found #757

Open
splashsky opened this issue Jun 13, 2024 · 3 comments
Open

CLI error This: command not found #757

splashsky opened this issue Jun 13, 2024 · 3 comments

Comments

@splashsky
Copy link

I've installed lightningcss-cli globally for Node, for Bun, and even copied the binary from those directly to /usr/local/bin. Whenever I to execute the lightningcss binary, I get this error:
/home/sky/.bun/bin/lightningcss: line 1: This: command not found
I'm not sure what other steps to take, but I'd like to be able to use the project.

@trymeouteh
Copy link

I get this for an error when I install LightningCSS globally and try to use it in the terminal on Linux Mint.

$ sudo npm i -g lightningcss
$ lightningcss
lightningcss: command not found
$ 

I even tried to restart my computer and the lightningcss command still does not work.

LightningCSS does work when installed as a local dev package in your workspace folder and is accessible using npm scripts, but I would like to be able to use this globally as you can use other tools globally like Rollup when you install Rollup as a global npm package.

@DylanPiercey
Copy link
Contributor

@trymeouteh I'm unsure about OP but for your issue I think you're installing the wrong package, it should be npm i -g lightningcss-cli.

@collindutrow
Copy link

collindutrow commented Oct 6, 2024

I experienced this today using bun.sh via macOS 15. The problem is that no binary is being created.
$HOME/.bun/bin/lightningcss is a symlink to ~/.bun/install/global/node_modules/lightningcss-cli/lightningcss which is a text file that contains "This file is required so that npm creates the lightningcss binary on Windows." whereas using npm to install lightningcss-cli seems to do so via brew.

The text is coming from here: https://github.com/parcel-bundler/lightningcss/blob/eb49015cf887ae720b80a2856ccbdf61bf940ef1/cli/lightningcss

Attempting to run this file (which is executable) via Zsh will produce
lightningcss: line 1: This: command not found

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants