npm run build

npm run bulid 失败

C:\work\官网\XXX>npm run build

> XXX@0.1.0 build C:\work\官网\XXX
> vue-cli-service build

'vue-cli-service' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! XXX@0.1.0 build: `vue-cli-service build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the precision-static-website@0.1.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\software\nodejs\node-cache\_logs\2019-12-18T02_46_15_060Z-debug.log

提示 没有这个文件
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
我们使用以下命令
npm install
就有了

 C:\work\官网\XXX>npm install

> yorkie@2.0.0 install C:\work\官网\XXX\node_modules\yorkie
> node bin/install.js

setting up Git hooks
done

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

added 1081 packages from 888 contributors in 520.336s


C:\work\官网\XX>npm --version
6.12.0

C:\work\官网\XXX>vue --version
@vue/cli 4.1.1

再次使用 npm run build

C:\work\官网\XXX>npm run build

> XX@0.1.0 build C:\work\官网\XX
> vue-cli-service build


\  Building for production...Browserslist: caniuse-lite is outdated. Please run next command `npm update`
|  Building for production...Browserslist: caniuse-lite is outdated. Please run next command `npm update`
Browserslist: caniuse-lite is outdated. Please run next command `npm update`
\  Building for production...Browserslist: caniuse-lite is outdated. Please run next command `npm update`
Browserslist: caniuse-lite is outdated. Please run next command `npm update`
Browserslist: caniuse-lite is outdated. Please run next command `npm update`
|  Building for production...Browserslist: caniuse-lite is outdated. Please run next command `npm update`
Browserslist: caniuse-lite is outdated. Please run next command `npm update`
\  Building for production...

 WARNING  Compiled with 1 warnings                                                            11:06:25

 warning

asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
This can impact web performance.
Assets:
  img/logo.ea6c7d15.png (482 KiB)
  img/contact-us-sale.709f89e2.jpg (676 KiB)

  File                                    Size              Gzipped

  dist\js\chunk-vendors.250c06ed.js       112.38 KiB        39.98 KiB
  dist\js\app.95fe4f6b.js                 16.92 KiB         6.63 KiB
  dist\js\chunk-44f30854.a11672a8.js      11.85 KiB         5.08 KiB
  dist\js\chunk-62954215.a2594c94.js      7.66 KiB          6.05 KiB
  dist\js\chunk-3b4a32e6.3940e945.js      6.40 KiB          2.03 KiB
  dist\js\chunk-1f894192.edce9cda.js      4.92 KiB          2.48 KiB
  dist\js\chunk-d9983780.7be8d9ab.js      4.11 KiB          3.01 KiB
  dist\css\chunk-44f30854.110731d3.css    16.18 KiB         2.41 KiB
  dist\css\app.ceab4039.css               13.54 KiB         2.85 KiB
  dist\css\chunk-1f894192.08186c21.css    10.34 KiB         1.89 KiB
  dist\css\chunk-62954215.ec1a6697.css    5.88 KiB          1.20 KiB
  dist\css\chunk-3b4a32e6.5808cbb2.css    5.73 KiB          1.10 KiB
  dist\css\chunk-d9983780.8e490963.css    5.18 KiB          1.04 KiB

  Images and other types of assets omitted.

 DONE  Build complete. The dist directory is ready to be deployed.
 INFO  Check out deployment instructions at https://cli.vuejs.org/guide/deployment.html

C:\work\官网\XXXX>

成功

posted @ 2019-12-18 11:17  lvph  阅读(3573)  评论(0编辑  收藏  举报