Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing Node.js (and npm) on Windows 10

I had some issues trying to install Node on Windows 10 and found the solution.

The error was as follows:

C:\Users\Stephan>npm
Error: ENOENT, stat 'C:\Users\Stephan\AppData\Roaming\npm'

The solution is below.

like image 280
Stephan Bijzitter Avatar asked Dec 07 '14 15:12

Stephan Bijzitter


People also ask

How do I install npm on Windows 10?

Step-1: Download node. Visit the official node. js site https://nodejs.org/en/download/ and click on Windows installer to download the necessary software in your system. The installer contains the NPM package. Based on the system you want to install, choose 32-bit installer or 64-installer and proceed.

Can I install Node.js in Windows 10?

js on the following versions of Windows: Windows 7, Windows 8, Windows 8.1, and Windows 10. These are the versions that are consistently tested and supported by the Node. js build process at the time of writing.


1 Answers

Edit: It seems like new installers do not have this problem anymore, see this answer by Parag Meshram as my answer is likely obsolete now.

Original answer:

Follow these steps, closely:

  • http://nodejs.org/download/ download the 64 bits version, 32 is for hipsters
  • Install it anywhere you want, by default: C:\Program Files\nodejs
  • Control Panel -> System -> Advanced system settings -> Environment Variables
  • Select PATH and choose to edit it.

If the PATH variable is empty, change it to this: C:\Users\{YOUR USERNAME HERE}\AppData\Roaming\npm;C:\Program Files\nodejs

If the PATH variable already contains C:\Users\{YOUR USERNAME HERE}\AppData\Roaming\npm, append the following right after: ;C:\Program Files\nodejs

If the PATH variable contains information, but nothing regarding npm, append this to the end of the PATH: ;C:\Users\{YOUR USERNAME HERE}\AppData\Roaming\npm;C:\Program Files\nodejs

Now that the PATH variable is set correctly, you will still encounter errors. Manually go into the AppData directory and you will find that there is no npm directory inside Roaming. Manually create this directory.

Re-start the command prompt and npm will now work.

like image 52
Stephan Bijzitter Avatar answered Sep 23 '22 19:09

Stephan Bijzitter