-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed
Labels
Bugthing that needs fixingthing that needs fixingPriority 2secondary priority issuesecondary priority issueRelease 8.xwork is associated with a specific npm 8 releasework is associated with a specific npm 8 release
Description
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
Using the npm_config_prefix results in a no such file or directory error when attempting to run a command via npx globally on [email protected]. The same command used to work on [email protected].
Expected Behavior
Global npx command works in conjunction with npm_config_prefix outside of a project/workspace.
Steps To Reproduce
$ mkdir repro
$ cd repro
$ npm i -g [email protected]
$ npm_config_prefix=/tmp/.foo npx serve@latest --help
# observe `serve` CLI is executed successfully and the help message is printed
Now, upgrade npm and repeat:
$ npm i -g [email protected]
$ npm_config_prefix=/tmp/.foo npx serve@latest --help
npm ERR! code ENOENT
npm ERR! syscall lstat
npm ERR! path /private/tmp/.foo/lib
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, lstat '/private/tmp/.foo/lib'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! /…/.npm/_logs/2022-08-05T21_22_57_389Z-debug-0.log
💥 Observe npx errors and complains This is related to npm not being able to find a file..
Environment
- npm:
- GOOD: 8.15.1
- BAD: 8.16.0
- Node.js: v16.14.0
- OS Name: macOS, Ubuntu 22
- System Model Name: M1 Macbook Pro, GitHub Action Runner
- npm config:
$ npm config ls
; node bin location = /Users/…/.nvm/versions/node/v16.14.0/bin/node
; node version = v16.14.0
; npm local prefix = /Users/…/Desktop/repro
; npm version = 8.16.0
; cwd = /Users/…/Desktop/repro
; HOME = /Users/…
; Run `npm config ls -l` to show all defaults.Additionally, npm_config_prefix is set when running npx command.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Bugthing that needs fixingthing that needs fixingPriority 2secondary priority issuesecondary priority issueRelease 8.xwork is associated with a specific npm 8 releasework is associated with a specific npm 8 release