windows下修改过package.json,npm start仍然报错,不能运行源代码

来源:3-2 todo-list-demo

慕崽

2018-08-02

$ npm start


> react-dianping-webpack@1.0.0 start F:\react-dianping-getready-perf-todolist

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


module.js:549

    throw err;

    ^


Error: Cannot find module 'webpack/bin/config-optimist'

    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> (F:\react-dianping-getready-perf-todolist\node_modules\webpack-dev-server\bin\webpack-dev-server.js:64:1)

    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: `set 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!     C:\Users\admin\AppData\Roaming\npm-cache\_logs\2018-08-02T06_12_06_089Z-debug.log


写回答

1回答

双越

2018-08-02

各个插件的版本,和视频中的一致吗?

0
1
慕崽
老师,我没修改过您的代码,我就是将原版本文件夹里的压缩包解压后, npm install,安装了所有package.json里的插件, 然后修改了pkg.json里的start和build, 再npm start ,就这样了 ??? 我朋友的电脑是Mac,我把原文件发给他,他的电脑就能运行的起来
2018-08-02
共1条回复

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

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

1711 学习 · 707 问题

查看课程