1

Hi I've just downloaded the 64 bit version of the node.js on windows and I want to use npm to install a package for me, but when i open the node.exe terminal and write : npm install sth it gives me this error: npm should be run outside of the node repl, in your normal shell. what should I do? how should I use npm with .exe version of the node.js?

Salar
  • 5,305
  • 7
  • 50
  • 78
  • The docs are misleading: npmjs.org says that npm is bundled with node, but when you download just the Windows .exe file, you're downloading a non-bundled version of NodeJS. I tried the .msi and it failed for me. This SO answer was helpful: http://stackoverflow.com/questions/7300132/how-to-use-npm-with-node-exe#15924944 – bdkosher Aug 06 '15 at 13:05

2 Answers2

1

The npm is an external command that should be used in the terminal, not node.exe repl. You should only use node.exe as repl - Read Print Eval Loop, or a tool where you input some javascript code and immediately see interpreted result, same as browser console (if you've ever used those to try out a javascript code snippet).

On windows, open cmd (Win + R and type cmd), then run the command you were trying to run within node.exe, for example npm update npm -g.

Marko Gresak
  • 7,950
  • 5
  • 40
  • 46
0

Run it from windows command shell cmd.exe

If it doesn't work from there, you might want to look at the answers at:

How to resolve 'npm should be run outside of the node repl, in your normal shell'

Community
  • 1
  • 1
bidhan
  • 70
  • 9