1、npm run dev 运行出错,报错如下:
> webpack-dev-server --inline --progress --config build/webpack.dev.conf.js
module.js:471
throw err;
^
Error: Cannot find module 'define-properties'
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (C:\Users\adoctors\Desktop\read\node_modules\_array-includes@3.0.3@array-includes\index.js:3:14)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! read@1.0.0 dev: `webpack-dev-server --inline --progress --config build/webpack.dev.conf.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the read@1.0.0 dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
解决方案:
方案一:卸载npm uninstall webpack-dev-server,在安装这个npm i webpack-dev-server@2.9.7。
方案二:删除node_modules目录,使用npm install(比cnpm问题少点,就是慢)。
一时也想不出别的了,遇到了再说,待续……