请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

npm start 报错

我下载了老师的代码包,运行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


正在回答 回答被采纳积分+3

1回答

双越 2018-07-27 21:39:41

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

0 回复 有任何疑惑可以回复我~
  • 提问者 慕仰7173844 #1
    老师能不能理一下从下载代码之后到npm start 之后需要的配置命令呢?因为我加入html-webpack-plugin 之后启动npm 还是报错了
    回复 有任何疑惑可以回复我~ 2018-07-27 21:51:03
  • 双越 回复 提问者 慕仰7173844 #2
    再把拨错截图发出来,肯定不和之前的报错一样了
    回复 有任何疑惑可以回复我~ 2018-07-27 22:22:07
  • 提问者 慕仰7173844 回复 双越 #3
    已经编辑原问题了,谢谢老师
    回复 有任何疑惑可以回复我~ 2018-07-27 22:34:12
问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信