npm start 时出现此错误。我尝试删除节点模块并再次执行 npm install 但修复了问题
- 多(webpack)-dev-server/client 中的错误?http://localhost:8080 ./main.js
找不到模块:错误:无法解析 '*****' 中的 'babel'
@multi (webpack)-dev-server/client? http://localhost:8080 ./main.js
webpack:编译失败
This is my webpack.config
module.exports = {
entry : './main.js',
output: {
path: '/',
filename: 'index.js'
},
devServer: {
inline: true,
port: 8083
},
module: {
loaders: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel',
query: {
presets: ['es2015','react']
}
}
]
}
}
This is my package.json
{
"name": "proj3",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "webpack-dev-server"
},
"author": "",
"license": "ISC",
"dependencies": {
"react": "^15.6.1",
"react-dom": "^15.6.1"
},
"devDependencies": {
"webpack": "^3.4.1",
"webpack-dev-server": "^2.6.1"
}
}