这是我用于React应用的启动脚本。
当我运行npm start时,我收到了一长串的错误信息。
"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 ERR! 路径 /home/user/workspace/shareback-viewer/node_modules/lint/package.json
我该怎么解决这个问题?