This npm install is not working on Windows
This works great in my Mac. But the same process on Windows and the npm install crashes. This is what I get.
I’ve tried everything I’ve seen on Stack Overflow so far and every link Google search produced. I tried the following as suggested here:
ran it as admin,
tried npm install -g
restarted the XAMPP server
checked the PATH for C:\Program Files\nodejs
Output
node -v gives me version 6.9.1.
npm -v gives me version 4.0.2.
Which proves they are all installed fine. Am I right?
8 Answers 8
After countless hours of debugging and researching, I decided to install on a different machine to see if the problem was with my Node.js installation. It worked.
Know that the possibility to uninstall Node.js and delete NPM will be there. This is what I did. I believe it is the safest way to solve the problem and all the rest of your applications installed in your machine will still work.
I credit this answer for these steps, although I had other npm and node_modules in other locations. So do a quick search for these and unless they are part of an application, make sure they are deleted as well.
Uninstall from Programs & Features with the uninstaller.
Reboot (or you probably can get away with killing all Node.js related processes from Task Manager).
Look for these folders and remove them (and their contents) if any still exist. Depending on the version you installed, UAC settings, and CPU architecture, these may or may not exist:
- C:\Program Files (x86)\Nodejs
- C:\Program Files\Nodejs
- C:\Users\
\AppData\Roaming\npm (or %appdata%\npm ) - C:\Users\
\AppData\Roaming\npm-cache (or %appdata%\npm-cache ) - C:\Users\
\.npmrc (and possibly check for that without the . prefix too)
Check your %PATH% environment variable to ensure no references to Node.js or npm exist.
If it’s still not uninstalled, type where node at the command prompt and you’ll see where it resides — delete that (and probably the parent directory) too.
Reboot, for good measure.
Please read the error carefully.
The FSEvents API in OS X allows applications to register for notifications of changes to a given directory tree.
It needs OS X, because some of the npm dependencies are using fsevents. That’s why it’s breaking on Windows.
As you were told, it’s working without fsevents. Then you can follow these steps:
Install npm-check-updates and try again.
It will update the dependencies and install the dependencies.
Update and then install again:
Add this to fix any errors:
The only solution that worked for me was deleting npm and npm-cache from C:\Users(your username)\AppData\Roaming.
And uninstalling Node.js and reinstalling it.
Please try to open the console as an administrator.
Do right-click on the command line and select "Open as administrator" and then try installing the dependency.
I tried to disabled all my antivirus and firewall, cleared the npm cache, and did cache verify, but nothing worked. The only thing that works on my end is to install the Node Version Manager, nvm .
How does Node Version Manager work?
Permission errors can occur when packages are installed globally. If this is the case, npm may need to be set up to operate without elevated permissions. This where nvm comes in. It lets you install a different Node.js version without triggering the administrative access.
If you have existing Node.js installed, I recommend uninstalling it like the process given by LOTUSMS above:
Uninstall from Programs & Features with the uninstaller.
Reboot (or you probably can get away with killing all node-related processes from Task Manager).
Look for these folders and remove them (and their contents) if any still exist. Depending on the version you installed, UAC settings, and CPU architecture, these may or may not exist:
C:\Program Files (x86)\Nodejs C:\Program Files\Nodejs
C:\Users
\AppData\Roaming\npm (or %appdata%\npm) C:\Users
\AppData\Roaming\npm-cache (or %appdata%\npm-cache) C:\Users
.npmrc (and possibly check for that without the . prefix too) Check your %PATH% environment variable to ensure no references to Nodejs or npm exist. If it’s still not uninstalled, type where node at the command prompt and you’ll see where it resides — delete that (and probably the parent directory) too.
Install nvm here — https://github.com/coreybutler/nvm-windows. or you can use curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash
Run nvm or command -v nvm . If something prints, the installation was successful.
Install the prefered node version — e.g. nvm use 16.3.0
Check if the node and npm are properly install. Just run node -v and npm -v
Не работает выполнение команды npm install
Не работает выполнение команды npm install, какая может быть проблема?
Добавлено через 18 минут
не работает npm install
Добрый день! Linux Manjaro 18 со всеми обновлениями. npm install не подгружает node_modules.
Не работает search и install в npm
Проблема такая. Хотел установить express, но ни отыскать, ни инсталлировать его не смог как потом.
To install them, you can run: npm install —save
Пробую сделать связку Failed to compile with 4 errors .
Npm install —save gh-pages (VK Apps)
Что это за ошибка? Выполняю: npm install —save gh-pages Выводится ошибка: npm WARN.
npm -g install <npm_package>not working as desired. Why ?? Why ?? Why??
But please don’t get into the delusion that your npm is working all good and correctly. Because that’s what is was thinking about.
Problem
OK, so whats the problem here. The problem can be with your global npm installation of the package. While all things are working just fine with running local project with its dependencies, there might be the problem with global installation of packages which might not get installed or if installed cannot be accessed in terminal bash command. And its a headache to solve. For me it was. Because first thing you google about this problem it it will say reinstall the npm properly.
The problem is mainly due to two reasons: (#as i have identified#haha)
- The npm is installed in the root directory and you need super user privileges to use it. This is easier problem to solve. Trust me.
2. Even though you have installed npm with standard user privileges, (you can check it, if you don’t get any error while installing npm -globally) but still not able to access global packages you are quite in a stuck.
Solution
Step 1: Check the npm package is really installed globally.
This will show your npm package list which are installed globally. If it then ALRIGHT we are in correct steps HAHA
Step 2: Next check the npm globally save path.
And its all good but why i’m not able to access.
Step 3: Change the permission of node global package. Here we won’t be tampering with default file permission rather change the directory itself with creating a new profile.
This is one of the recommended things done by npm official itself ie if you don’t trust me.
Step 4: All these above steps are done and you will find it all the forum and blogs easily. But still it doesn’t work.
So still why there is the problem. Let me take a minute to make you understand. For any command to work in bash easily. There must be a script file or path defined in /bin folder to be able to access. If it is not there how can your system know this is the path to search. Common sense it’s it.
The simple way is to make a syslink of the going to
/.npm-global/<package> but every time is not a good fix here. So here is the final step to solve it.
Step 5: Go to .profile file in the HOME_DIRECTORY and change it yourself manually.
Add the following lines manually.
It was done in above steps too but if it wasn’t saved in .profile file you have to do it manually.
Restart the system as you are changing the system config file and bash doesn’t take effect without it.
npm install is not working in Windows 10 #15719
I have installed nodejs latest on Windows 10 (64-bit) and the PATH is already setup. Now when i am trying to install any npm modules globally using npm install -g <packagename> then I am getting the following error:
The npm-debug.log shows:
I do not understand the error in windows 10 while installing npm packages. Please let me know if this can be fixed.
The text was updated successfully, but these errors were encountered:
jpaulin commented Feb 13, 2017
I think you are installing ‘Yeoman’, which used to be called ‘yo’ — both the shell tool and the npm package.
It’s still the same software, and the ‘yo’ is used as CLI, but the package is now named ‘yeoman’.
Try this instead:
npm install -g yeoman
hemakh commented Feb 15, 2017
For yoeman, it is npm install -g yo taken from this http://yeoman.io/learning/
I tried with yoeman also i am getting the same error
AlexRouk commented Feb 15, 2017
Hello
I had similar issue and I found that it was related to firewall / proxy (the installation process tried and didn’t succeed to access some external content).
hope this will help someone..
amiraba commented Apr 1, 2017
Had the same issue.
Run the git bash or the command line console as an administrator when launching the npm install command
Worked for me ! 😉
npm-robot commented Jun 17, 2017
We’re closing this issue as it has gone seven days without activity and without being labeled. If we haven’t even labeled in issue in seven days then we’re unlikely to ever read it.
If you are still experiencing the issue that led to you opening this or this is a feature request you’re still interested in then we encourage you to open a new issue. If this was a support issue, you may be better served by joining package.communty and asking your question there.
For more information about our new issue aging policies and why we’ve instituted them please see our blog post.