【发布时间】:2017-05-24 09:04:50
【问题描述】:
这是我的 React 应用程序的启动脚本。
"scripts": {
"prestart": "babel-node tools/startMessage.js",
"start": "npm-run-all --parallel test:watch open:src lint:watch",
"open:src": "babel-node tools/srcServer.js",
"lint": "node_modules/.bin/esw webpack.config.* src tools",
"lint:watch": "npm run lint -- --watch",
"test": "mocha --reporter progress tools/testSetup.js \"src/**/*.test.js\"",
"test:watch": "npm run test -- --watch",
"clean-dist": "npm run remove-dist && mkdir dist",
"remove-dist": "node_modules/.bin/rimraf ./dist",
"build:html": "babel-node tools/buildHtml.js",
"prebuild": "npm-run-all clean-dist test lint build:html",
"build": "babel-node tools/build.js",
"postbuild": "babel-node tools/distServer.js"
},
当我运行 npm start 时,我得到一长串错误。
npm ERR! System Linux 3.10.0-327.36.3.el7.20161025.20.x86_64
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "run" "lint" "--" "--watch"
npm ERR! cwd /home/user/workspace/shareback-viewer
npm ERR! node -v v0.10.30
npm ERR! npm -v 1.4.21
npm ERR! path /home/user/workspace/shareback-viewer/node_modules/lint/package.json
npm ERR! code ENOENT
npm ERR! errno 34......
很明显,npm 脚本失败了,因为它试图寻找错误的路径。 npm 错误!路径 /home/user/workspace/shareback-viewer/node_modules/lint/package.json
我该如何解决这个问题?
【问题讨论】:
-
顺便说一句……帮自己一个忙,升级到当前版本的 nodejs nodejs.org/en v7.4.0 你正在使用 v0.10.30
-
啊哎呀,我想这可能是问题所在。解析不正确。