'webpack-dev-server' 未被识别为内部或外部命令, [英] 'webpack-dev-server' is not recognized as an internal or external command,

查看:106
本文介绍了'webpack-dev-server' 未被识别为内部或外部命令,的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我按照关于 pluralsight 的教程使用 gitbash 通过 github 克隆了这个 Webpack Starter 包.我正在尝试通过 Visual Studio Code 的集成终端访问 webpack,但出现以下错误.我是新手,所以请帮助我.

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 integrated terminal but i get the following error. I am new to this so kindly help me on this.

我正在运行一个命令

 Raza Zaidi@RazaZaidi-PC MINGW64 ~/webpack-starter (master)
$ npm run dev

然后出现以下错误

> yet-another-webpack-es6-starterkit@1.0.0 dev C:\Users\Raza Zaidi\webpack-starter
> webpack-dev-server --open --config webpack/webpack.config.dev.js

'webpack-dev-server' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! yet-another-webpack-es6-starterkit@1.0.0 dev: `webpack-dev-server --open --config webpack/webpack.config.dev.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the yet-another-webpack-es6-starterkit@1.0.0 dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Raza Zaidi\AppData\Roaming\npm-cache\_logs\2018-08-14T20_16_29_017Z-debug.log

推荐答案

running

npm install -g webpack-dev-server

npm install -g webpack-dev-server

在 cmd 中以管理员身份解决了我的问题.我希望它可以帮助其他人.

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

这篇关于'webpack-dev-server' 未被识别为内部或外部命令,的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆