我将devDependencies
和dependencies
{
"name": "contenttype",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"react": "^15.3.2",
"react-dom": "^15.3.2"
},
"scripts": {
"dev": "webpack-dev-server --content-base src --inline --hot"
},
"devDependencies": {
"babel-core": "^6.18.2",
"babel-loader": "^6.2.7",
"babel-preset-es2015": "^6.18.0",
"babel-preset-react": "^6.16.0",
"webpack": "^1.13.3"
}
}
正如您所看到的,我有一个npm
脚本,但当我运行npm run dev
时,我收到了错误
webpack module not found
为什么? webpack模块位于我的devDependencies
中,为什么不进行重新识别?
答案 0 :(得分:1)
npm install webpack-dev-server --save-dev