npm is not recognised as an internal or external command - install using nvm

JPi*_*Pil 6 node.js npm nvm

I am trying to install nodejs and npm on my Windows 10 PC. Below are the steps I followed for the same

  1. Downloaded nvm set up from here
  2. Installed nvm install wizard using nvmsetup.exe
  3. Opened command prompt and typed in 'nvm install v5.1.0
  4. typed in nvm use 5.1.0
  5. typed in node -v and got the response back v5.1.0
  6. but when I tried npm --version I am getting error saying npm is not recognized as an internal or external command

我更新了环境变量以设置 PATH C:Program Files\nodejs。重新启动电脑,并重新启动命令提示符仍然没有成功。非常感谢对此的任何帮助。谢谢

小智 12

使用 . 从一个节点版本切换到另一个节点版本后,我遇到了同样的问题nvm use ----。显然 nvm 在某个时候禁用了自己并使用nvm on启用了它,现在我可以再次访问 npm 了。

解决方案来自检查此页面讨论相同的问题

  • 这在 Windows 11 中适用于我。但是当我打开 nvm 时,它再次切换到最新的节点 (2认同)