猿问

这种问题怎么解决啊,大佬

Error: Cannot find module 'webpack/bin/config-optimist'                          
   at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)     
   at Function.Module._load (internal/modules/cjs/loader.js:508:25)               
   at Module.require (internal/modules/cjs/loader.js:637:17)                      
    at require (internal/modules/cjs/helpers.js:22:18)                              
    at Object.(C:\Users\asus\Desktop\pro11ject\m18jup\admin\node_modules\webpack-dev-server\bin\webpack-dev-server.js:64:1)                             
    at Module._compile (internal/modules/cjs/loader.js:701:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)        
    at Module.load (internal/modules/cjs/loader.js:600:32)                          
    at tryModuleLoad (internal/modules/cjs/loader.js:539:12)                        
    at Function.Module._load (internal/modules/cjs/loader.js:531:3)             
    npm ERR! code ELIFECYCLE                                                        
    npm ERR! errno 1                                                                
    npm ERR! mmall_admin_fe@1.0.0 dev_win: `set WEBPACK_ENV=dev && webpack-dev-server --port 8086 --inline --secure false`                                          
    npm ERR! Exit status 1                                                          
    npm ERR!                                                                        
    npm ERR! Failed at the mmall_admin_fe@1.0.0 dev_win 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:\Program Files\nodejs\node_cache\_logs\2019-05-11T12_52_10_724Z-debug.log


慕瓜6237018
浏览 1957回答 1
1回答

__innocence

一般这种问题,是有些包下载失败了。我们可以使用cnpm,具体做法:1、把node_modules文件夹先删掉 2、如果没安装过cnpm,就去安装一下: npm install -g cnpm 3、cnpm install
随时随地看视频慕课网APP
我要回答