-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
[BUG] npx failed to install package and exec, when the user HOME dir is a symlink #3431
Comments
self troubleshooting:
in Step.2, the incorrect https://github.com/npm/cli/blob/v7.17.0/node_modules/libnpmexec/lib/index.js#L127-L132 and https://github.com/npm/cli/blob/v7.17.0/lib/utils/config/definitions.js#L313-L314 https://github.com/npm/cli/blob/v7.17.0/lib/utils/config/definitions.js#L81-L83 there is the source of not realpath if npm run scripts in package.json which has npx, (e.g. ...
"scripts": {
"server": "unset npm_config_cache && HOME=`realpath ~` npx serve",
...
},
... due to https://github.com/npm/cli/blob/v7.17.0/node_modules/@npmcli/config/lib/index.js#L346-L358 |
…symlink, see npm/cli#3431 detail issue: npm/cli#3431
try fix by make |
…symlink, see npm/cli#3431 detail issue: npm/cli#3431
Here's the root cause fix: https://gist.github.com/isaacs/c02d6c2f72cbbbb0c7c5be856d8bac8a Repro cases: https://gist.github.com/isaacs/3e61667df31f750f88030eb16ed9191a |
I have read the |
This expands the behavior that was previously only done for global roots, but should really be done for _any_ root dir that is not accessed via its realpath. Fixes: npm/cli#3431
Will be fixed when npm/arborist#294 lands. |
npx in npm v6 didn't use any of this code. npm v7 is a very different animal. |
thanks, I have confirmed it fixed in npm@7.19.0 |
Is there an existing issue for this?
Current Behavior
I have't globally or locally install
serve
, and thenpx serve
command is first command I executed afternpm i -g npm@7
, so I don't have any npm/npx cache.Expected Behavior
Steps To Reproduce
HOME (~)
dir is a symlink (like mount on some other disk)~/.npm/_npx/
npx serve
Environment
The text was updated successfully, but these errors were encountered: