-
Notifications
You must be signed in to change notification settings - Fork 327
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
ncu -g does not seems to work with custom node/npm installations. #1315
Comments
npm-check-updates does its best to guess the correct npm prefix based on the OS. Unfortunately, it looks like this is a regression from #297 (coming back to haunt us 7 years later 😅). While The original problem is documented in #146 and #163, with especially useful information in #163 (comment). A few questions:
|
$ npm config get prefix
D:\nodejs
$ which.exe npm
/d/nodejs/npm
$ node -p process.execPath
D:\nodejs\node.exe I'll try to debug what is going on with |
Okay, this turned interesting... The On the generated log-file in
at line 5 it did loaded
I suppose this is the default path that comes with all installations, therefore not from your Now the interesting part... at line 10 it did tried to load $ echo %HOME%
D:\msys2\home\dc Here's the log-file from running
as you can see in line 11, the fwiw, i do mainly use the git-for-windows's bash, but running the commands you asked me under a normal windows cmd terminal did yield the same results. All that being said, i am not sure if you could come with some workaround for this given the above information, but in any case i will remove the symlink i made for |
Oh... i thought that was NodeJS's native Perhaps i should file a ticket in that other repo (?) 😉 |
Very interesting. Thanks for investigating. So if I'm following you correctly, the What do you get when you run
It's raineorshine all the way down... 🐢 |
Yes, you're following me correctly :) $ node -p "console.log(process.env.HOME)"
D:\msys2\home\dc
undefined Btw, AFAICT, Node's child-process.spawn does uses by default |
Thanks. That confirms the problem is with the spawn call. After some further investigation, spawn option
https://nodejs.org/api/child_process.html#child_processspawncommand-args-options In fact, I'll publish a prerelease with |
Okay, hold, let me give it a try - as long it doesn't break running this through Bash on Windows we'll be good :) |
er... nope, it doesn't work.
--- npm.js 2023-08-20 15:20:39.816120000 +0200
+++ npm.js.sh 2023-08-20 15:19:16.644871000 +0200
@@ -460,3 +460,3 @@
try {
- prefix = await (0, spawn_please_1.default)(cmd, ['config', 'get', 'prefix']);
+ prefix = await (0, spawn_please_1.default)(cmd, ['config', 'get', 'prefix'], {shell: true});
}
@@ -467,2 +467,4 @@
}
+ console.log('defaultPrefix().prefix = ', prefix);
+ // process.exit(1)
// FIX: for ncu -g doesn't work on homebrew or windows #146 |
Well, the same way the Let me know if i should try to hackpatch any of the spawn-packages (didn't even looked at them, but i guess the issue is there) |
Dang. So we could use
Yeah, it's hard to tell what's going on. spawn sets env to I'm open to ideas. Figuring out how to get |
Yep, well for the time being i am happy with the Thanks for your time and help 🙇🏻 👍🏻 |
npm-check-updates
node >= 14.14
Hi there,
at first it was not clear what was going on, but upon running
ncu --verbose -g
found there aoptions.prefix
pointing to%APPDATA%\npm
but that path here doesn't exists (because nodejs is not installed on the system drive)I made a symlink and got
ncu -g
working again, but... perhaps ncu should be using theNODE_PATH
environment variable for this "prefix" value (?)fwiw, on
~/.npmrc
i do have:and
NODE_PATH
does point toD:\nodejs\node_modules
(the before mentioned symlink does point to this path)Please let me know if i do have to provide further troubleshooting details, and/or if i can help in some other way.
Thanks!
The text was updated successfully, but these errors were encountered: