2016-09-14 86 views
0

我已经安装了node.js.节点似乎工作正常,但是,npm没有找到,如下所示。我安装了Node.js,但是我无法在windows上使用npm

C:\Users\jpdrc>node -v 
v6.5.0 

C:\Users\jpdrc>node hello.js 
node is installed! 

C:\Users\jpdrc>npm -v 
module.js:457 
    throw err; 
    ^
Error: Cannot find module 'strip-ansi' 
    at Function.Module._resolveFilename (module.js:455:15) 
    at Function.Module._load (module.js:403:25) 
    at Module.require (module.js:483:17) 
    at require (internal/module.js:20:19) 
    at Object.<anonymous> (C:\Users\jpdrc\AppData\Roaming\npm\node_modules\npm\node_modules\npmlog\node_modules\gauge\node_modules\string-width\index.js:2:17) 
    at Module._compile (module.js:556:32) 
    at Object.Module._extensions..js (module.js:565:10) 
    at Module.load (module.js:473:32) 
    at tryModuleLoad (module.js:432:12) 
    at Function.Module._load (module.js:424:3) 

我已经尝试了多种解决方案,为那些提出:

1- Windows -installed node.js but npm not found

2- Installing Node.js (and npm) on Windows 10

我不知道下一个尝试

感谢援助

Here are my variables under path

正如以下建议我用where npm

C:\Users\jpdrc>where npm 
C:\Program Files\nodejs\npm 
C:\Program Files\nodejs\npm.cmd 
+0

它在你的PATH? – Kosch

+0

是的,我有从应用程序的数据在那里npm – jpdrcarneiro

+0

尝试'在哪里npm'来检查是否有任何其他破的npm命令.. – lastr2d2

回答

0

步骤解决上述问题:

  1. 检查是否已加入环境变量“路径”
  2. 节点的路径,如果它是那么有检查NPM是有目录,你已经加入了路径。
  3. 如果在所需文件夹中有npm,则转到CMD,然后转到安装npm的目录,然后尝试再次运行版本命令。如果仍然遇到同样的问题,那么可能有两种可能性:

    a。安装不正确,请重新安装

    b。可能存在代理问题,因为软件包没有被下载

不能有任何其他问题。

相关问题