npm ERR! mathine_call@1.0.0 dev: `webpack-dev-server --inline --progress --config build/webpack.dev.conf.js` npm ERR! Exit status 1

internal/modules/cjs/loader.js:583
throw err;
^ Error: Cannot find module 'webpack'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
at Function.Module._load (internal/modules/cjs/loader.js:507:25)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:20:18)
at Object.<anonymous> (/Users/shenzhenshimujinkejiyouxiangongsi/node_modules/webpack-cli/bin/convert-argv.js:7:24)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! mathine_call@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 mathine_call@1.0.0 dev 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/shenzhenshimujinkejiyouxiangongsi/.npm/_logs/2018-11-20T07_03_05_024Z-debug.log
 // Various Dev Server settings
host: '192.168.0.21', // can be overwritten by process.env.HOST
port: 1026, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
autoOpenBrowser: true,
errorOverlay: true,
notifyOnErrors: true,
poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-

如果如上方法不行的话,

webpack-dev-server  版本需要从最新版本降低到如下版本,因为开始构建项目的那个人所用的插件版本太低
"webpack-dev-server": {
"version": "2.11.3",
"resolved": "https://registry.npmjs.org/webpack-dev-server/-/webpack-dev-server-2.11.3.tgz",
"integrity": "sha512-Qz22YEFhWx+M2vvJ+rQppRv39JA0h5NNbOOdODApdX6iZ52Diz7vTPXjF7kJlfn+Uc24Qr48I3SZ9yncQwRycg==",
"dev": true,
"requires": {
"ansi-html": "0.0.7",
"array-includes": "^3.0.3",
"bonjour": "^3.5.0",
"chokidar": "^2.0.0",
"compression": "^1.5.2",
"connect-history-api-fallback": "^1.3.0",
"debug": "^3.1.0",
"del": "^3.0.0",
"express": "^4.16.2",
"html-entities": "^1.2.0",
"http-proxy-middleware": "~0.17.4",
"import-local": "^1.0.0",
"internal-ip": "1.2.0",
"ip": "^1.1.5",
"killable": "^1.0.0",
"loglevel": "^1.4.1",
"opn": "^5.1.0",
"portfinder": "^1.0.9",
"selfsigned": "^1.9.1",
"serve-index": "^1.7.2",
"sockjs": "0.3.19",
"sockjs-client": "1.1.5",
"spdy": "^3.4.1",
"strip-ansi": "^3.0.0",
"supports-color": "^5.1.0",
"webpack-dev-middleware": "1.12.2",
"yargs": "6.6.0"
},
上一篇:Spring 注解原理(三)@Qualifier @Value


下一篇:opencv_形态学结构化元素对形态学图像处理的影响