Skip to content
New issue

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

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

Already on GitHub? # to your account

[BUG] npx fails to run without empty lib directory #6351

Closed
2 tasks done
knpwrs opened this issue Apr 13, 2023 · 1 comment
Closed
2 tasks done

[BUG] npx fails to run without empty lib directory #6351

knpwrs opened this issue Apr 13, 2023 · 1 comment
Labels
Bug thing that needs fixing Needs Triage needs review for next steps Release 9.x work is associated with a specific npm 9 release

Comments

@knpwrs
Copy link

knpwrs commented Apr 13, 2023

Is there an existing issue for this?

  • I have searched the existing issues

This issue exists in the latest npm version

  • I am using the latest npm

Current Behavior

When node is installed with hermit, npx does not work:

npm ERR! code ENOENT
npm ERR! syscall lstat
npm ERR! path /Users/knpwrs/Downloads/hermit-npx-bug/.hermit/node/lib
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, lstat '/Users/knpwrs/Downloads/hermit-npx-bug/.hermit/node/lib'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

Creating the .hermit/node/lib directory via mkdir -p .hermit/node/lib appears to fix this issue, even though the directory doesn't contain anything.

See cashapp/hermit-packages#309, the hermit maintainers believe this is a bug with npx.

Expected Behavior

npx should work without needing an empty lib directory to exist.

Steps To Reproduce

  1. Install hermit
  2. mkdir hermit-npx-bug && cd hermit-npx-bug
  3. hermit init
  4. . ./bin/activate-hermit
  5. hermit install node
  6. which npx (this will verify the hermit-installed npx is being used)
  7. npx rimraf --help (this will fail)
  8. mkdir -p .hermit/node/lib
  9. npx rimraf --help (this works now!)

Environment

  • npm: 9.2.0
  • Node.js: 19.4.0
  • OS Name: macOS Ventura 13.1
  • System Model Name: Macbook Pro
  • npm config:
; "user" config from /Users/knpwrs/.npmrc

//registry.npmjs.org/:_authToken = (protected)

; "env" config from environment

cache = "/Users/knpwrs/Downloads/hermit-npx-bug/.hermit/node/cache"
prefix = "/Users/knpwrs/Downloads/hermit-npx-bug/.hermit/node"

; node bin location = /Users/knpwrs/Library/Caches/hermit/pkg/node-19.9.0/bin/node
; node version = v19.9.0
; npm local prefix = /Users/knpwrs/Downloads
; npm version = 9.6.3
; cwd = /Users/knpwrs/Downloads/hermit-npx-bug
; HOME = /Users/knpwrs
; Run `npm config ls -l` to show all defaults.
@knpwrs knpwrs added Bug thing that needs fixing Needs Triage needs review for next steps Release 9.x work is associated with a specific npm 9 release labels Apr 13, 2023
@milaninfy
Copy link
Contributor

fixed in #7640

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Bug thing that needs fixing Needs Triage needs review for next steps Release 9.x work is associated with a specific npm 9 release
Projects
None yet
Development

No branches or pull requests

2 participants