Vue project error: webpack-dev-server is not an internal or external command

 

Error Reporting: webpack-dev-server is not an internal or external command

wrong reason:

When executing the command: npm run dev actual implementation is package.json configuration:

"dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
Equivalent: npm run webpack-dev-server --inline --progress --config build / webpack.dev.conf.js
 

Possible causes: No installation webpack-dev-server 

Global Installation: (generally no problem globally after installation) npm install webpack-dev-server -g


Local installation: npm install webpack-dev-server --save-dev

 At this time there is a new bug report

'cross-env' is not an internal or external command, operable program
or batch file.

 npm install --save-dev cross-env

Error: Cannot find module 'webpack'
Solve: npm install --save-dev webpack   
Error: Cannot find module 'webpack-cli/bin/config-yargs'
Solve npm install --save-dev webpack-cli
 Cannot find module 'mini-css-extract-plugin'
Solve npm install --save-dev mini-css-extract-plugin
Cannot find module 'webpack-merge'
npm install --save-dev webpack-merge
 Cannot find module 'vue-loader'
npm install --save-dev vue-loader

If you find it necessary to install so many dependencies, you need to immediately look at the author's instructions.

Because there may be only "npm install" on it. 

  Reference: https: //segmentfault.com/q/1010000006939078

 

Error Reporting: webpack-dev-server is not an internal or external command

wrong reason:

When executing the command: npm run dev actual implementation is package.json configuration:

"dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
Equivalent: npm run webpack-dev-server --inline --progress --config build / webpack.dev.conf.js
 

Possible causes: No installation webpack-dev-server 

Global Installation: (generally no problem globally after installation) npm install webpack-dev-server -g


Local installation: npm install webpack-dev-server --save-dev

 At this time there is a new bug report

'cross-env' is not an internal or external command, operable program
or batch file.

 npm install --save-dev cross-env

Error: Cannot find module 'webpack'
Solve: npm install --save-dev webpack   
Error: Cannot find module 'webpack-cli/bin/config-yargs'
Solve npm install --save-dev webpack-cli
 Cannot find module 'mini-css-extract-plugin'
Solve npm install --save-dev mini-css-extract-plugin
Cannot find module 'webpack-merge'
npm install --save-dev webpack-merge
 Cannot find module 'vue-loader'
npm install --save-dev vue-loader

If you find it necessary to install so many dependencies, you need to immediately look at the author's instructions.

Because there may be only "npm install" on it. 

  Reference: https: //segmentfault.com/q/1010000006939078

Guess you like

Origin www.cnblogs.com/yzccc/p/12316810.html