当我在rails-react网站的命令行中运行 npm start
时,出现以下错误:
web_page@ start web-page
> node run webpack -- --watch
module.js:471
throw err;
^
Error: Cannot find module '/web-page/run'
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.runMain (module.js:604:10)
at run (bootstrap_node.js:390:7)
at startup (bootstrap_node.js:150:9)
at bootstrap_node.js:505:3
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! web_page@ start: `node run webpack -- --watch`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the web_page@ start script.
npm ERR! This is probably not a problem with npm. There is likely additional
logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/Me/.npm/_logs/...-debug.log
看起来我应该根据错误消息包含一个名为“run”的模块,但我不确定这需要包含什么 .
这是我的package.json文件:
{
"name": "web_page",
"private": true,
"main": "webpack.config.js",
"engines": {
"node": "6.10.3"
},
"scripts": {
"heroku-postbuild": "NODE_ENV=production npm run webpack -- -p",
"test": "node_modules/.bin/karma start react/karma.conf.js",
"start": "node run webpack -- --watch",
"webpack": "node_modules/.bin/webpack --config ./react/webpack.config.js"
},
"author": "",
"license": "ISC",
"devDependencies": {
"enzyme": "^2.9.1",
"isparta-loader": "2.0.0",
"jasmine-ajax": "3.2.0",
"jasmine-core": "^2.4.1",
"jasmine-enzyme": "^3.4.0",
"karma": "^0.13.22",
"karma-coverage": "0.5.5",
"karma-jasmine": "^0.3.8",
"karma-phantomjs-launcher": "^1.0.4",
"karma-sourcemap-loader": "0.3.7",
"karma-spec-reporter": "0.0.26",
"karma-webpack": "2.0.1",
"node-sass": "^4.5.1",
"phantomjs-prebuilt": "^2.1.14",
"react-addons-test-utils": "^15.6.0",
"redux-devtools": "3.2.0",
"sass-loader": "^6.0.3",
"static-site-generator-webpack-plugin": "^3.4.1",
"webpack-dev-server": "^2.9.0",
"whatwg-fetch": "^2.0.3"
},
"dependencies": {
"babel-polyfill": "^6.23.0",
"react": "^15.6.1",
"react-dom": "^15.6.1",
"webpack": "^2.6.0",
"babel-core": "^6.5.1",
"babel-loader": "^6.2.2",
"babel-preset-es2015": "^6.5.0",
"babel-preset-react": "^6.5.0"
}
}
很抱歉,如果这是一个简单的问题,我是新手编码,可以使用我能得到的所有帮助 . 谢谢!