2017-04-22 38 views
0
[email protected] start C:\Users\Vaibhav\Desktop\reactApp 
webpack-dev-server 

'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! [email protected] start: `webpack-dev-server` 
npm ERR! Exit status 1 
npm ERR! 
npm ERR! Failed at the [email protected] start script 'webpack-dev-server'. 
npm ERR! Make sure you have the latest version of node.js and npm installed. 
npm ERR! If you do, this is most likely a problem with the learnreact package, 
npm ERR! not with npm itself. 
npm ERR! Tell the author that this fails on your system: 
npm ERR!  webpack-dev-server 
npm ERR! You can get information on how to open an issue for this project with: 
npm ERR!  npm bugs learnreact 
npm ERR! Or if that isn't available, you can get their info via: 
npm ERR!  npm owner ls learnreact 
npm ERR! There is likely additional logging output above. 

npm ERR! A complete log of this run can be found in: 
npm ERR!  C:\Users\Vaibhav\AppData\Roaming\npm-cache\_logs\2017-04-22T13_06_29_371Z-debug.log 
+2

您是否安裝了dev服務器用'npm install webpack-dev-server --save-dev'? –

+0

是的,我遵循了這裏提到的步驟 - https://www.tutorialspoint.com/reactjs/reactjs_environment_setup.htm – user3051613

回答

-1

如果你已經安裝了它,可執行正在node_modules/.bin文件 你可以使用

./node_modules/.bin/webpack-dev-server 

$(npm bin)/webpack-dev-server 
+0

如果已安裝,並且可執行文件位於'。/ node_modules/.bin'下,則添加完整路徑爲因爲'npm start'(和所有npm腳本)在路徑上已經有'./ node_modules/.bin'可用,所以沒有意義。 – RyanZim