You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
installer will not overwrite user's .npmrc, even if invalid #12345
the Node.js binary itself is in the PATH, but the globally installed packages are not.
I reinstalled the latest nodejs( using nodejs-v7.8.0-x64.msi), and expect the installer can fix it. But it did not.
Shouldn't npm prefix -g be C:\Users\hh\AppData\Roaming\npm on your system? At least, that's what I'd suppose looking at your PATH. Well, I don't think my Windows knowledge is sufficient to make a conclusion about whether it is a genuine installer bug or some other issue related to your system or, probably, prior configuration, so let's wait for Windows people here, maybe @refack.
Looking at the thread in the NPM repo and the original post here:
npm -v prints: v7.8.0 node -v prints: 4.2.0
I suppose, it's all the other way around. Can you please update your comment so that it's not confusing about which version of Node the issue is related to?
changed the title [-]the Nodejs installer can not set the right `PATH` on window 10 [/-][+]the Nodejs installer can not set the right `PATH` on windows 10 [/+]on Apr 11, 2017
Now where the installer should cleanup (override) prior configuration? definatly an edge-case.
Maybe low priority bug, or feature request (check box in installer to Force Override)
So the installer will not override an existing .npmrc (in your case C:\Users\hh\.npmrc)
You can edit it yourself; either set a prefix, or remove the line to fall back to the default (C:\Users\hh\AppData\Roaming\npm)
Also you have a non default registry, and your cache is in an administrator access folder
.npmrc in the user directory can created by npm config set with no -g
For now the installer will not change user customization (via .npmrc or etc/npmrc), so enabling overriding is a feature request.
Also a good option is to validate that the value of npm prefix -g is writable (that may be an npm feature)
changed the title [-]the Nodejs installer can not set the right `PATH` on windows 10 [/-][+]installer will not override user's .npmrc, even if invalid[/+]on Apr 11, 2017
changed the title [-]installer will not override user's .npmrc, even if invalid[/-][+]installer will not overwrite user's .npmrc, even if invalid[/+]on Apr 11, 2017
Activity
aqrln commentedon Apr 11, 2017
Just to be sure I've understood you correctly: the Node.js binary itself is in the PATH, but the globally installed packages are not?
aladdin-add commentedon Apr 11, 2017
yes.
PATH
npm prefix -g
aladdin-add commentedon Apr 11, 2017
npm/npm#16313
aqrln commentedon Apr 11, 2017
Shouldn't
npm prefix -gbeC:\Users\hh\AppData\Roaming\npmon your system? At least, that's what I'd suppose looking at your PATH. Well, I don't think my Windows knowledge is sufficient to make a conclusion about whether it is a genuine installer bug or some other issue related to your system or, probably, prior configuration, so let's wait for Windows people here, maybe @refack.Looking at the thread in the NPM repo and the original post here:
I suppose, it's all the other way around. Can you please update your comment so that it's not confusing about which version of Node the issue is related to?
[-]the Nodejs installer can not set the right `PATH` on window 10 [/-][+]the Nodejs installer can not set the right `PATH` on windows 10 [/+]refack commentedon Apr 11, 2017
From first look it seems like prior configuration. There are afew issues I can see:
Path=...C:\Program Files (x86)\nodejs\...Path=...C:\Users\hh\AppData\Roaming\npm...npm prefix -g> C:\Program Files\nodejsnpm prefixis for the x64 directory.npm prefiximplies annpmrcsomewhere@aladdin-add can you run
npm config listrefack commentedon Apr 11, 2017
Now where the installer should cleanup (override) prior configuration? definatly an edge-case.
Maybe low priority bug, or feature request (check box in installer to Force Override)
refack commentedon Apr 11, 2017
P.S. Anyone remembers why thethe globalnpmfolder is in thePATH?npmfolder is in the PATH for the bin shims.aladdin-add commentedon Apr 11, 2017
refack commentedon Apr 11, 2017
So the installer will not override an existing
.npmrc(in your caseC:\Users\hh\.npmrc)You can edit it yourself; either set a prefix, or remove the line to fall back to the default (
C:\Users\hh\AppData\Roaming\npm)Also you have a non default
registry, and yourcacheis in anadministratoraccess folderOhh, or run
npm config set prefix xxxxxxxxxxxaladdin-add commentedon Apr 11, 2017
thanks. I'm not sure whether the
.npmrcis manually created.we can give users an option to select override prior configuration or not. you recon?
refack commentedon Apr 11, 2017
.npmrcin the user directory can created bynpm config setwith no-gFor now the installer will not change user customization (via
.npmrcoretc/npmrc), so enabling overriding is a feature request.Also a good option is to validate that the value of
npm prefix -gis writable (that may be annpmfeature)[-]the Nodejs installer can not set the right `PATH` on windows 10 [/-][+]installer will not override user's .npmrc, even if invalid[/+]refack commentedon Apr 11, 2017
Renamed issue and marked "feature request", also IMHO not specifically a
windowsissue.[-]installer will not override user's .npmrc, even if invalid[/-][+]installer will not overwrite user's .npmrc, even if invalid[/+]Fishrock123 commentedon Apr 12, 2017
I don't think we specifically set the
.npmrcat all.refack commentedon Apr 12, 2017
@Fishrock123 if the user uninstalls node will not
/etc/npmrcbe removed?Fishrock123 commentedon Apr 12, 2017
There is no MacOS uninstaller, and the Windows one lives here if you can find anything in there: https://github.com/nodejs/node/tree/master/tools/msvs/msi
refack commentedon Apr 12, 2017
It is the
wixlogic not to removes files it does not know. So to answer my own question: no. (changed comment above)bnoordhuis commentedon Oct 5, 2017
It's been six months with no movement and it doesn't strike me as an installer bug in the first place. Should we close this?