We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Try to install something on global npm install -g [package] an error is thrown:
npm install -g [package]
37 verbose stack RangeError: Maximum call stack size exceeded 37 verbose stack at isPathSeparator (node:path:52:25) 37 verbose stack at resolve (node:path:217:13) 37 verbose stack at realpathCached (C:\Program Files\nodejs\node_modules\npm\node_modules\@npmcli\arborist\lib\realpath.js:18:10) 37 verbose stack at realpathCached (C:\Program Files\nodejs\node_modules\npm\node_modules\@npmcli\arborist\lib\realpath.js:38:10)
I added some logging to realpath.js to see what it was doing...
console.log(depth, dir, path, dir == path, base);
undefined \\SOURCE2\Users\danF\AppData\Roaming \\SOURCE2\Users\danF\AppData\Roaming\npm false npm NaN \\SOURCE2\Users\danF\AppData \\SOURCE2\Users\danF\AppData\Roaming false Roaming NaN \\SOURCE2\Users\danF \\SOURCE2\Users\danF\AppData false AppData NaN \\SOURCE2\Users\ \\SOURCE2\Users\danF false danF NaN \\SOURCE2\Users\ \\SOURCE2\Users\ true Users NaN \\SOURCE2\Users\ \\SOURCE2\Users\ true Users NaN \\SOURCE2\Users\ \\SOURCE2\Users\ true Users NaN \\SOURCE2\Users\ \\SOURCE2\Users\ true Users NaN \\SOURCE2\Users\ \\SOURCE2\Users\ true Users ...repeats until stack overflow or whatever
Expected bahavior...it works? i guess. Given this the repeating directory error, I changed line 33 from:
if (!base) { rpcache.set(dir, dir) return Promise.resolve(dir) }
to
if (!base || dir == path) { rpcache.set(dir, dir) return Promise.resolve(dir) }
so that it recognizes that it has ascended as far as it can and reached the effective 'base'.
I'm no node.js/npm master, so i don't claim that this is a good fix but, i can install things globally now.
Windows 11. local Domain joined to Windows server, using folder redirection.
I'm not sure what other information to provide here. In this environment, all you have to do is try to install something globally and it fails.
; "builtin" config from \\SOURCE2\Users\danF\AppData\Roaming\npm\node_modules\npm\npmrc prefix = "\\\\SOURCE2\\Users\\danF\\AppData\\Roaming\\npm" ; "user" config from C:\Users\danF.LEE\.npmrc loglevel = "verbose" ; node bin location = C:\Program Files\nodejs\node.exe ; node version = v20.11.1 ; npm local prefix = C:\Users\danF.LEE ; npm version = 10.5.0 ; cwd = C:\Users\danF.LEE ; HOME = C:\Users\danF.LEE
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
Try to install something on global
npm install -g [package]
an error is thrown:I added some logging to realpath.js to see what it was doing...
Expected Behavior
Expected bahavior...it works? i guess.
Given this the repeating directory error, I changed line 33 from:
to
so that it recognizes that it has ascended as far as it can and reached the effective 'base'.
I'm no node.js/npm master, so i don't claim that this is a good fix but, i can install things globally now.
Steps To Reproduce
Windows 11. local Domain joined to Windows server, using folder redirection.
I'm not sure what other information to provide here. In this environment, all you have to do is try to install something globally and it fails.
Environment
The text was updated successfully, but these errors were encountered: