sh: webpack-dev-server: command not found 错误

公司的项目前端代码,技术栈用的是react+dva+react-router+antd,没有采用服务器端渲染,拉下来后npm install,太慢了,换了cnpm install,安装完成。

"dev": "webpack-dev-server --progress --config ./webpack.dev.config.js",

然后npm run dev,报错

sh: webpack-dev-server: command not found 错误_第1张图片

我看网上有人说需要把 webpack-dev-server 全局安装,然后把webpack-dev-server放在命令行配置的路径中,我感觉这种做法不太好。

贴一下项目的依赖配置

 "dependencies": {
    "antd": "^2.12.1",
    "babel-runtime": "^6.9.2",
    "classnames": "^2.2.5",
    "dva": "^1.2.1",
    "dva-loading": "^0.2.1",
    "font-awesome": "^4.7.0",
    "html-webpack-plugin": "^2.28.0",
    "jquery": "^1.12.4",
  

你可能感兴趣的:(运维,webpack,javascript,ViewUI)