npm包版本低, 运行起来报错
Closed this issue · 5 comments
yubaoquan commented
peerDependencies WARNING webpack-dev-server@^3.0.0 requires a peer of webpack@^4.0.0-beta.1 but webpack@3.11.0 was installed
peerDependencies WARNING webpack-dev-server@3.1.1 › webpack-dev-middleware@3.0.1 requires a peer of webpack@^4.0.0 but webpack@3.11.0 was installed
The CLI moved into a separate package: webpack-cli.
Please install 'webpack-cli' in addition to webpack itself to use the CLI.
-> When using npm: npm install webpack-cli -D
-> When using yarn: yarn add webpack-cli -D
module.js:538
throw err;
^
Error: Cannot find module 'webpack-cli/bin/config-yargs'
at Function.Module._resolveFilename (module.js:536:15)
at Function.Module._load (module.js:466:25)
at Module.require (module.js:579:17)
升级版本之后webpack配置也要修改
Brooooooklyn commented
使用 yarn 安装依赖
yubaoquan commented
用yarn也报错
The CLI moved into a separate package: webpack-cli.
Please install 'webpack-cli' in addition to webpack itself to use the CLI.
-> When using npm: npm install webpack-cli -D
-> When using yarn: yarn add webpack-cli -D
module.js:538
throw err;
^
Error: Cannot find module 'webpack-cli/bin/config-yargs'
at Function.Module._resolveFilename (module.js:536:15)
at Function.Module._load (module.js:466:25)
at Module.require (module.js:579:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/Users/baoquanyu/Documents/code/other/learning-rxjs/node_modules/webpack-dev-server/bin/webpack-dev-server.js:65:1)
at Module._compile (module.js:635:30)
at Object.Module._extensions..js (module.js:646:10)
at Module.load (module.js:554:32)
at tryModuleLoad (module.js:497:12)
at Function.Module._load (module.js:489:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! rxjs-todomvc@0.1.0 dev: `webpack-dev-server --inline --progress --port 3000 --content-base src`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the rxjs-todomvc@0.1.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/xxx/.npm/_logs/2018-04-02T03_00_05_630Z-debug.log
ERROR: "dev" exited with 1.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! rxjs-todomvc@0.1.0 start: `npm-run-all -p serve dev`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the rxjs-todomvc@0.1.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! /Users/xxx/.npm/_logs/2018-04-02T03_00_05_750Z-debug.log
安装完webpack-cli又报错
/Users/baoquanyu/Documents/code/other/learning-rxjs/node_modules/ajv-keywords/keywords/instanceof.js:52
throw new Error('invalid "instanceof" keyword value ' + c);
^
Error: invalid "instanceof" keyword value Promise
at getConstructor (/Users/baoquanyu/Documents/code/other/learning-rxjs/node_modules/ajv-keywords/keywords/instanceof.js:52:11)
at Ajv.compile (/Users/baoquanyu/Documents/code/other/learning-rxjs/node_modules/ajv-keywords/keywords/instanceof.js:21:27)
at Object.useCustomRule (/Users/baoquanyu/Documents/code/other/learning-rxjs/node_modules/ajv/lib/compile/index.js:274:26)
at Object.generate_custom [as code] (/Users/baoquanyu/Documents/code/other/learning-rxjs/node_modules/ajv/lib/dotjs/custom.js:32:24)
at Object.generate_validate [as validate] (/Users/baoquanyu/Documents/code/other/learning-rxjs/node_modules/ajv/lib/dotjs/validate.js:347:35)
at Object.generate_anyOf [as code] (/Users/baoquanyu/Documents/code/other/learning-rxjs/node_modules/ajv/lib/dotjs/anyOf.js:34:27)
at generate_validate (/Users/baoquanyu/Documents/code/other/learning-rxjs/node_modules/ajv/lib/dotjs/validate.js:347:35)
at localCompile (/Users/baoquanyu/Documents/code/other/learning-rxjs/node_modules/ajv/lib/compile/index.js:87:22)
at Ajv.compile (/Users/baoquanyu/Documents/code/other/learning-rxjs/node_modules/ajv/lib/compile/index.js:56:13)
at Ajv._compile (/Users/baoquanyu/Documents/code/other/learning-rxjs/node_modules/ajv/lib/ajv.js:351:27)
at Ajv.compile (/Users/baoquanyu/Documents/code/other/learning-rxjs/node_modules/ajv/lib/ajv.js:117:37)
at validateObject (/Users/baoquanyu/Documents/code/other/learning-rxjs/node_modules/webpack/lib/validateSchema.js:36:23)
at validateSchema (/Users/baoquanyu/Documents/code/other/learning-rxjs/node_modules/webpack/lib/validateSchema.js:31:10)
at processConfiguredOptions (/Users/baoquanyu/Documents/code/other/learning-rxjs/node_modules/webpack-cli/bin/convert-argv.js:156:48)
at module.exports (/Users/baoquanyu/Documents/code/other/learning-rxjs/node_modules/webpack-cli/bin/convert-argv.js:150:10)
at Object.<anonymous> (/Users/baoquanyu/Documents/code/other/learning-rxjs/node_modules/webpack-dev-server/bin/webpack-dev-server.js:234:54)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! rxjs-todomvc@0.1.0 dev: `webpack-dev-server --inline --progress --port 3000 --content-base src`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the rxjs-todomvc@0.1.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/xxx/.npm/_logs/2018-04-02T03_01_40_114Z-debug.log
ERROR: "dev" exited with 1.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! rxjs-todomvc@0.1.0 start: `npm-run-all -p serve dev`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the rxjs-todomvc@0.1.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! /Users/xxx/.npm/_logs/2018-04-02T03_01_40_242Z-debug.log
Brooooooklyn commented
保证项目是干净的(checkout 掉所有本地的变更),保证 yarn.lock 存在,并且使用 yarn && yarn dev
启动
Brooooooklyn commented
resoved in 3d20806
yubaoquan commented
可以了 👍