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
NPM not installed with node #199
Comments
UPDATE >nvm install 4.4.7
Downloading node.js version 4.4.7 (64-bit)... Complete
Creating C:\Users\myusernamewithoutspaces\AppData\Roaming\nvm\temp
Downloading npm version 2.15.8... Complete
Installing npm v2.15.8...
Installation complete. If you want to use this version, type
nvm use 4.4.7 Notice the Original Response I would check to make sure the It might be worth trying to uninstall/reinstall the version you want. At the end of the day, NVM4W just hands control off to node/npm once the files are downloaded/extracted. The challenge is, sometimes the download can show a false positive (i.e. didn't complete the npm download but says it did). I suspect this might be what's happening for you. |
Thanks @coreybutler. I'm not behind a proxy, but there is a basic firewall. I tried a fresh install of NVM4W and Any other ideas? I'll also check the node install docs about issues with installing npm if it's handing off control |
I don't think you need to install NVM4W with the firewall off (since it was responding)... but you might want to test running |
yep, I did do the install with firewall off and it didn't help. I'm not sure how to test what else may be going wrong with the download or otherwise. If you have any other ideas let me know! |
I'm experiencing this same issue using nvm 1.1.1 and windows 10. Is there any information you need to help debug. This one is really weird to me. It will work for a while then eventually stops working and can no longer find npm. @NealHumphrey if you uninstall the version you are using then delete the install folder for that version in your nvm root, then reinstall, this usually works for a couple weeks for me then it will stop working again with the same error you have reported. |
@LeeGDavis - I haven't ever been able to get it to work, even reinstalling the Node version or reinstalling NVM4W and then Node. For debugging - when you are able to get it to work, what are the contents of these two folders? And then next time it stops working for you, can you check again on what the contents are? |
@LeeGDavis - If it just stops working after a period of time, there is definitely something going on in your environment. NVM4W doesn't touch anything, ever, unless you run an @NealHumphrey - Just to clarify, you are running |
Having the same issue. Turned off my McAfee firewall and the installation seems to have worked this time: the Tested the installation by switching to my newly installed version of Node (6.2.2) and executing the UPDATE: had to uninstall because reasons. When I reinstalled (firewall still off), the problem reappeared: the UPDATE 2: Turned off the firewall and virus scanner and it worked again, using the command prompt in administrator mode. |
@NealHumphrey and @coreybutler The problem happened again under a week, so I switched to vanilla node, but will switch back to nvm this week-end to help debug. I am not on any domain controlled/active directory setup and no scheduled tasks. In regards to install, nvm never reports a failure, but removing the install folder in the nvm root is needed to get it working again once the executable gets nuked from the path or whatever is happening... |
Had this exact same problem. Uninstalled MVN, turned off Mcafee real time protection and firewall, reinstalled it, and the error vanished. |
Definitely an antivirus issue. However; it sounds like it might be something that could be modified in the settings. I verified this morning that NVM4W is whitelisted by Mcafee. |
The windows box I am using is vanilla windows 10 pro installation. No other third party antivirus or firewall installed, besides the default Windows defender and firewall I suppose. What is odd for me a particular version (of node installed through nvm4w) will work for a time before it appears to just stop working and the only way to restore it appears to be what I described above. |
@LeeGDavis Windows Defender can remove files as well. However; NVM4W is whitelisted there too. I recommend reviewing your |
As for not getting npm installed, I still think it's just the firewall/antivirus blocking the download of npm from the node distribution site. If @frankorama's solution works, this is the case and there's not much that can be done within NVM4W to prevent that. I can try adding exceptions to the firewall in the installer at some point, but that doesn't mean they wouldn't get overwritten by 3rd party software. |
@coreybutler @LeeGDavis Windows Defender was the culprit for me |
I had this issue. (windows 7x64, nvm v1.1.1)
or catch an error and try again (after 1 sec sleep) UPD |
@se-m Thanks for the insight. The order is important, but it seems like there's a synchronicity problem.... at least in your environment. Which version of Go are you running your tests with? If file movement is indeed the problem, I don't like using sleepers because it doesn't really solve the problem. |
@coreybutler i used go1.7 for my test (just print the error) If you will not use the sleepers or reorder, I can only suggest using a "copy" comand instead of "move". To all.
|
@se-m Yeah, the plan would be to use a copy. This way a checksum can be matched with the download, then again once the copy is complete. Logging can be applied to both steps, checking for file integrity and permissions. |
Rather than use either sleepers or an extra copy I'd just catch the known exception and retry, this way you won't have a race condition and you can retry X times before giving up to cope with slow "spinning rust" disks or the case of someone installing to a network synced roaming profile. |
I know this is a bit old, but can confirm that disabling McAfee while installing worked. |
Also I had to disable 360 TS to get it working, thanks |
Had this same issue. What fixed it for me: removing "C:\Users\{your_username}\AppData\Roaming\npm" from my PATH variable. I think it was leftovers from a previous node install. |
I have the same problem @office where we have mcAfee enterprise, when it works fine on my home pc. |
@yuxblank I am in the same boat as you - McAfee Enterprise at the office. Disabling it is not an option. Your solution helped me. |
I've tried the suggested method and whilst it does get npm working, global installs still do not work for me - with the same behaviour as npm, the node_modules just being empty other than what I have manually copied in. Was this the same for you guys also? |
I've a fresh install of Windows 10 Pro with no previous installed npm or node and currently I have node installed via |
Same issue Windows 10 pro while installing 8.9.1. Got node, but \nvm\v8.9.1\node_modules is empty as is c:\program files\nodejs\node_modules. Work computer has McAffee that cannot be disabled. I will download npm and manually install. |
+1
If I switched back to installed 9.5.0 node version(installed not using nvm) then |
Unfortunately for me, nothing of the above is working. McAfee is disabled, defender is off, but i still get the problem. As AlainD noted, I AM seeing it download and stage in temp...but if i try to do what he suggests, I end up in an empty folder. Nothing is copied to node_modules AND the folder I am in is empty - the trail of folders down to where i was is all that remains. So yeah, the problem is definitely the move/copy from temp to node_modules that has the problem. Yes I've tried running as administrator cmd as well as regular. I haven't put git bash on this box yet. |
resolved by copying the npm folder (under nodemodules) from the zip archive I've manually downloaded from nodejs.org. Not perfect but solved the McAfee issue. |
I also had the same problem, but mine was rather incomplete npm install after switching to node 10.7.0 and npm 6.1.0 - it first lacked uuid package, then semver package in C:\ProgramData\nvm\v10.7.0\node_modules\npm. I don't have McAfee, though I do have COMODO anti-virus. My solution was almost the same as YafimK's - but I just copied the npm-v6.1.0.zip from nvm\temp folder, and then manually unpacked it into C:\ProgramData\nvm\v10.7.0\node_modules\npm. Judging from its contents, you can simply download the same folder from https://github.com/npm/cli/releases without meddling with temp folders. Hope this helps somebody. I also hope nvmw resolves this issue. |
This seems to be an intermittent issue. nvm uninstall 9.4
rm -r ~\AppData\Roaming\nvm\v9.4.0
nvm install 9.4
nvm use 9.4
Start-Sleep -Seconds 1
npm --version If I run this script repeatedly from PowerShell as an administrator, sometimes it sometimes succeeds installing npm, and sometimes it fails with the error, So basically, I'm able to get it working just by uninstalling and reinstalling until it randomly works. |
npm changed their repo from npm/npm to npm/cli. It would have affected any install of Node 10.8.0+. This has been fixed in 1.1.7. |
@coreybutler Well that's mildly infuriating to say the least :/ Thanks for fixing though. |
Just installed nvm 1.1.7 and still have this issue on Windows 10 Enterprise 1709. |
Same situation as ralfhandl here. |
@robertmain - indeed. npm has changed things several times without so much as a peep. @ralfhandl & @mmascolino - just making sure... you ran |
I'm closing this issue for the following reasons:
If you're still experience an issue like this, open a new issue. |
Definitely did a nvm use 8.11.4 before trying to use npm |
Node 8.x.x is subject to npm's hard-coded permissions (see #300). Can someone with Win 10 Enterprise (@mmascolino or @ralfhandl) try with a newer or older version of Node? I see no reason why NVM4W would behave differently in that flavor of Windows, but there is the known npm issue in Node 8.x.x that could be the culprit. |
I've installed Node versions 10.9.0, 8.11.4, 6.14.4, and 6.9.0. In all cases |
here you go:
The node_modules folder ( |
Same as @mmascolino here |
Same as @mmascolino here, the only difference on me is the destination folder for node versions which is c:\ProgramData\nvm\v10.11.0. The node_modules folder is completely empty. |
same |
I'm also having the same issue. |
Make sure you've removed prior installations of Node (as instructed in the README). This is the most common reason for these errors, because npm is getting confused between versions. Notice the error states Also check your temp directory, in @mmascolino's case it would be |
@coreybutler IMO, the README needs to be improved. If this is an required step, it should be its own paragraph and bolded. This is the current copy:
This doesn't highlight the importance of uninstalling existing versions, nor does it provide an easy way for users to do that. If this is a requirement for |
@cdtinney - The installer has a note about this in it. I can't make it bold (in the installer), but there is a screen for it. Feel free to update the README and submit a PR. I'd accept it. |
Hi, I had a similar issue to the one reported here using nvm 1.1.7 on Windows 10 which has been resolved in the latest head of master. Essentially, nvm was downloading nodejs, npm zip was correctly downloaded and extracted. The copy to the nodes_module directory failed however with no error. I pulled the latest master version and built locally the install worked correctly. One issue I did notice when debugging is that on line Line 298 in 0a258f8
If the move fails after the retries, the error is not logged or the install does not fail. Would you be able to release a new version from the latest version of master? Thanks for the work & kind regards, |
I just had this issue. I have tried all solutions except disabling McAfee, which I'm not allowed to do so the only solution that worked for me is to download node's Windows Binary zip file, unzip it, and move the npm folder located in its node_module and place it in the one created by nvm-windows located in C:\Program Files\nodejs\node_modules |
My env is Windows 10 64bit 1803, using latest nvm windows 1.1.7. Some people needs to edit npm.cmd and add the PATH. (somewhere below nvm directory, probably nvm\vX.Y.Z\npm.cmd) At line 6, node executable file is specified. This tries to use node.exe in the same directory. After that, you need to add the directory where npm.cmd exists to PATH. I don't know this also works fine if you use and switch multiple nodejs versions. |
Can confirm McAfee breaks npm. We already excluded a specific folder, just install nvm and npm paths into that folder. |
I had this issue too. |
Change the installation directory to C:\ NVM 🎉 |
I'm locking this conversation because new issues should be filed as.... new issues. |
My Environment
I have already...
My issue is related to (check only those which apply):
Expected Behavior
After installing nvm-windows using the installer and then installing a version of node using
>nvm install latest
or>npm install 4.4.7
. I expect to be able to type>npm help
into the command line to verify npm is working (and then of course use it to install packages).Actual Behavior
While nvm says that npm was installed, the folders containing node_modules are blank:
...\AppData\Roaming\nvm\v4.4.7\node_modules
(empty)C:\Program Files\nodejs\node_modules
(empty)Steps to reproduce the problem:
First I installed nvm 1.1.1 from here: https://github.com/coreybutler/nvm-windows/releases
I installed node version 4.4.7 using
nvm install 4.4.7
. All nvm commands work correctly includingnvm use
and I can run a hello world script in node.During installation, I get the following command line output:
When I then type
npm help
into the command line I get this error:Thanks for any help!
The text was updated successfully, but these errors were encountered: