NPM启动“找不到模块”

时间:2018-11-10 08:43:38

标签: node.js reactjs npm npm-scripts npm-start

当我尝试使用命令npm start时,控制台将运行npm install并返回以下错误:

> npm@6.4.1 prepare C:\Users\Aristophanes
> node bin/npm-cli.js --no-audit --no-timing prune --prefix=. --no-global && rimraf test/*/*/node_modules && make -j4 doc

internal/modules/cjs/loader.js:589
    throw err;
    ^

Error: Cannot find module 'C:\Users\Aristophanes\bin\npm-cli.js'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:587:15)
    at Function.Module._load (internal/modules/cjs/loader.js:513:25)
    at Function.Module.runMain (internal/modules/cjs/loader.js:760:12)
    at startup (internal/bootstrap/node.js:308:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:878:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! npm@6.4.1 prepare: `node bin/npm-cli.js --no-audit --no-timing prune --prefix=. --no-global && rimraf test/*/*/node_modules && make -j4 doc`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the npm@6.4.1 prepare script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

完整日志:https://www.dropbox.com/s/de0369plkz8w2ir/2018-11-10T07_56_03_314Z-debug.log?dl=0

谁能解释Cannot find module 'C:\Users\Aristophanes\bin\npm-cli.js'错误?在目录C:\Users\Aristophanes\bin\中,只有以下文件:

create-react-native-app 
create-react-native-app.cmd

要查找的npm-cli.js文件实际上位于C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js

有人建议解决此问题吗?谢谢。

0 个答案:

没有答案