'webpack-dev-server' is not recognized as an internal or external command,

后端 未结 4 1461
名媛妹妹
名媛妹妹 2021-01-17 17:06

I cloned this Webpack Starter package through github using gitbash following a tutorial on pluralsight. I am trying to access webpack through Visual Studio Code\'s integrate

相关标签:
4条回答
  • 2021-01-17 17:45

    For me, instead of installing webpack-dev-server globally, I simply uninstalled and reinstalled the local package:

    npm uninstall webpack-dev-server
    npm install webpack-dev-server
    
    0 讨论(0)
  • 2021-01-17 17:54

    Recent versions of Webpack & WDS need webpack-cli package, I recommend you to downloaded if your Webpack version is 4 or higher

    0 讨论(0)
  • 2021-01-17 18:00

    running

    npm install -g webpack-dev-server

    in cmd as an administrator solved my problem. I hope it helps others.

    0 讨论(0)
  • 2021-01-17 18:08

    Webpack command should be present in location: node_modules\.bin\

    In this case in package.json file we are referring to webpack-dev-server, but locally webpack-dev-server doesn't exist.

    First run following command for global installation:

    npm install -g webpack-dev-server
    

    Second execute local installation command, which will create node_modules\.bin\webpack-dev-server:

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