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

npx scripts fail #97

Closed
AaronFeledy opened this issue Mar 5, 2025 · 0 comments · Fixed by #98
Closed

npx scripts fail #97

AaronFeledy opened this issue Mar 5, 2025 · 0 comments · Fixed by #98
Labels
bug Something isn't working

Comments

@AaronFeledy
Copy link
Member

On a basic node:20 service, npx scripts won't run.

$ lando npx cowsay "Hello World"
npm error code ENOENT
npm error syscall lstat
npm error path /var/www/.npm-global
npm error errno -2
npm error enoent ENOENT: no such file or directory, lstat '/var/www/.npm-global'
npm error enoent This is related to npm not being able to find a file.
npm error enoent
npm error A complete log of this run can be found in: /home/node/.npm/_logs/2025-03-05T18_25_08_720Z-debug-0.log

This is because npx tries to open .npm-global which doesn't exist in the container, and there is no error handling for that situation so it crashes.

Normally installing npx or any other global package would create that directory and there would be no issue, but since we're using the npx that comes with the container, that directory doesn't exist on a fresh image.

@AaronFeledy AaronFeledy added the bug Something isn't working label Mar 5, 2025
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.

1 participant