Error: Cannot find module ‘webpack/lib/RequestShortener’
at Function.Module._resolveFilename (module.js:548:15)
at Function.Module._load (module.js:475:25)
at Module.require (module.js:597:17)
at require (internal/module.js:11:18)
at Object.
(C:UsersjoshtDevelopmentkaraoke-butlerkaraokeclientnode_modulesterser-webpack-plugindistindex.js:19:25)
at Module._compile (module.js:653:30)
at Object.Module._extensions…js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! react-client@1.0.0 build: react-scripts build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the react-client@1.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
从git上拉了一个项目下来准备先本地运行调试一下,然后就一直报这个错:Cannot find module ‘webpack/lib/RequestShortener’
上网一搜真是什么方法都有,基本都是说webpack出问题,改的我都要崩溃了!!
终于,最后是找到了一篇国外的blog, 他删掉了package-lock.json和node_modules后,再全局npm install,然后就成功了,我照着试了一下,惊喜!我也成功了!!!
还来不及分析原因,项目还在测试中。。。