基本上从非常流行的fullstack 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 run test - --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
答案 0 :(得分:0)
我遇到了同样的问题并且拥有与您相同版本的节点(v0.10.25)。 我的解决方案是将节点更新到最新版本(v4.4.3)。
使用the node website的安装程序更新了节点,npm run test -- --watch
工作正常。