[英]How to solve npm error "npm ERR! code ENOENT" after trying ```npm run build```
[英]npm run “npm run ” enoent error
基本上是從非常流行的全棧Redux教程進行復制和粘貼。 我無法弄清楚為什么第二次npm運行在node_modules文件夾中尋找該腳本,而與package.json文件相反
"scripts": {
"test": "mocha --compilers js:babel-core/register --require ./test/test_helper.js --recursive",
"test:watch": "npm run test -- --watch"
},
npm運行測試---watch
npm ERR! Error: ENOENT, open '/home/l2silver/react-redux-rest/node_modules/test/package.json'
npm ERR! If you need help, you may report this log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <npm-@googlegroups.com>
npm ERR! System Linux 3.19.0-47-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "run" "test" "--" "--watch"
npm ERR! cwd /home/l2silver/react-redux-rest
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.10
npm ERR! path /home/l2silver/react-redux-rest/node_modules/test/package.json
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/l2silver/react-redux-rest/npm-debug.log
npm ERR! not ok code 0
npm ERR! weird error 34
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian
npm ERR! not ok code 0
我遇到了同樣的問題,並且節點版本與您的版本相同(v0.10.25)。 我的解決方案是將node更新到最新版本(v4.4.3)。
使用節點網站上的安裝程序和npm run test -- --watch
更新了節點npm run test -- --watch
運行正常。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.