NPM:运行 npm 时未找到 npm-cli.js [英] NPM: npm-cli.js not found when running npm
问题描述
通常我可以使用 npm 安装一个库,但是今天在安装 yeoman 时我遇到了这个错误.请帮助找出根本原因.
Usually I can install a library using npm but today when installing yeoman I encountered this errors. Please help to figure out what's root cause.
D:Worksphonegapionic odo>npm install -g yo
module.js:340
throw err;
^
Error: Cannot find module 'C:Program Files
odejs
ode_modules
pmin
ode_modules
pmin
pm-cli.js'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:906:3
我查看了文件夹:
C:Program Files odejs ode_modules pmin
C:Program Files odejs ode_modules pmin
但没有看到 node_modules 文件夹作为所描述的错误.
but don't see node_modules folder as the error described.
我也尝试找到 npm-cli.js 并看到它实际上在 C:Program Files
odejs
ode_modules
pmin
I also try to find npm-cli.js and see it's actually in C:Program Files
odejs
ode_modules
pmin
推荐答案
原来问题是由于系统变量中节点的路径错误.路径当前指向
It turns out the issue is due to the wrong path of node in system variable. The path is currently pointing to
(我真的不知道什么时候修改过)
(I really don't know when I modified it)
C:Program Files
odejs
ode_modules
pmin
所以我改成
C:Program Files
odejs
它就像一个魅力.
这篇关于NPM:运行 npm 时未找到 npm-cli.js的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!