webpack-dev-server Cannot find module 'webpack'

前端 未结 2 1592
情深已故
情深已故 2020-12-23 17:17

I\'m trying to use webpack-dev-server to run a simple program but I\'m getting this error:

module.js:471
    throw err;
    ^

Error: Cannot find module \'we         


        
相关标签:
2条回答
  • 2020-12-23 17:56

    I had the same problem, but I resolved by installing additional webpack-cli

    npm install --save-dev webpack-cli
    
    0 讨论(0)
  • 2020-12-23 18:11

    npm install --save-dev webpack is not enough.

    You also have to install the following:

    npm install --save-dev webpack-dev-server 
    

    And optionally, you can also install:

    npm install --save-dev webpack-dev-middleware webpack-hot-middleware
    
    0 讨论(0)
提交回复
热议问题