npm start 报错

来源:1-5 体验npm start 和 npm run build命令

慕仰7173844

2018-07-27

我下载了老师的代码包,运行npm install 后 运行npm start, 报错了。

错误如下:

Error: Cannot find module 'html-webpack-plugin'

    at Function.Module._resolveFilename (module.js:547:15)

    at Function.Module._load (module.js:474:25)

    at Module.require (module.js:596:17)

    at require (internal/module.js:11:18)

    at Object.<anonymous> (/Users/yedongyu/Desktop/m10f3h/webpack.config.js:3:25)

    at Module._compile (module.js:652:30)

    at Object.Module._extensions..js (module.js:663:10)

    at Module.load (module.js:565:32)

    at tryModuleLoad (module.js:505:12)

    at Function.Module._load (module.js:497:3)

npm ERR! code ELIFECYCLE

npm ERR! errno 1

npm ERR! react-dianping-webpack@1.0.0 start: `NODE_ENV=dev webpack-dev-server --progress --colors`

npm ERR! Exit status 1

npm ERR! 

npm ERR! Failed at the react-dianping-webpack@1.0.0 start 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!     /Users/yedongyu/.npm/_logs/2018-07-27T13_12_32_144Z-debug.log





这个是添加html组件后的报错:

+ html-webpack-plugin@2.30.1

updated 1 package in 3.715s

kanous-MacBook-Pro:m10f3h yedongyu$ npm start


> react-dianping-webpack@1.0.0 start /Users/yedongyu/Desktop/m10f3h

> NODE_ENV=dev webpack-dev-server --progress --colors


 70% 1/1 build modules[HPM] Proxy created: /api  ->  http://localhost:3000

events.js:183

      throw er; // Unhandled 'error' event

      ^


Error: listen EACCES 0.0.0.0:80

    at Object._errnoException (util.js:992:11)

    at _exceptionWithHostPort (util.js:1014:20)

    at Server.setupListenHandle [as _listen2] (net.js:1338:19)

    at listenInCluster (net.js:1396:12)

    at doListen (net.js:1505:7)

    at _combinedTickCallback (internal/process/next_tick.js:141:11)

    at process._tickCallback (internal/process/next_tick.js:180:9)

    at Function.Module.runMain (module.js:695:11)

    at startup (bootstrap_node.js:191:16)

    at bootstrap_node.js:612:3

npm ERR! code ELIFECYCLE

npm ERR! errno 1

npm ERR! react-dianping-webpack@1.0.0 start: `NODE_ENV=dev webpack-dev-server --progress --colors`

npm ERR! Exit status 1

npm ERR! 

npm ERR! Failed at the react-dianping-webpack@1.0.0 start 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!     /Users/yedongyu/.npm/_logs/2018-07-27T13_49_18_761Z-debug.log


写回答

1回答

双越

2018-07-27

提示没有安装 html-webpack-plugin 这个模块,再重新 npm intall html-webpack-plugin 试试

0
4
双越
回复
慕仰7173844
通过报错信息不太容易找到原因。对了,你各个插件的版本,和视频中一样吗?
2018-07-30
共4条回复

React高级实战 打造大众点评Web App

已经对React Router4与Webpack2进行了项目升级

1711 学习 · 707 问题

查看课程