Run cnpm start and run "webpack-dev-server". After running "webpack-dev-server", an error is reported: webpack is not found.
The contents of the packge.json file are as follows:
{
"name": "test",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "webpack-dev-server "
},
"author": "",
"license": "ISC",
"dependencies": {
"webpack-dev-server": "^2.4.5"
}
}
webpack.config.js:
Run:
Error:
I installed webpack globally. I don’t know why it reports that webpack cannot be found.
But manually enter 'webpack-dev-server'
Run successfully:
Hope to know the reason
Try it
npm run start
webpack.config.js
里使用了webpack
,所以webpack
You also need to partially install (this project) dependencies;