问答详情
源自:3-2 配置vue的jsx写法以及postcss

版本依赖问题,提示安装webpack cli,咋整呢?

按照课程的所使用包和插件的版本号进行安装,如npm i webpack@3.10.0 

到这一节npm run dev的时候提醒按照 webpack  cli,咋整呢?

azdeMacBook-Pro:vue-ssr az$ npm run dev


> vue-ssr@1.0.0 dev /Users/az/Desktop/vue-ssr

> cross-env NODE_ENV=development webpack-dev-server --config webpack.config.js


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 i -D webpack-cli

-> When using yarn: yarn add -D webpack-cli

internal/modules/cjs/loader.js:583

    throw err;

    ^


Error: Cannot find module 'webpack-cli/bin/config-yargs'

    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:22:18)

    at Object.<anonymous> (/Users/az/Desktop/vue-ssr/node_modules/webpack-dev-server/bin/webpack-dev-server.js:84:1)

    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! vue-ssr@1.0.0 dev: `cross-env NODE_ENV=development webpack-dev-server --config webpack.config.js`

npm ERR! Exit status 1

npm ERR!

npm ERR! Failed at the vue-ssr@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/az/.npm/_logs/2019-01-10T06_35_37_868Z-debug.log


提问者:az_web 2019-01-10 14:44

个回答

  • SanHuo
    2019-01-10 16:24:51

    安装呗。

    npm i -D webpack-cli