执行 npm run build后显示如下信息后终端任务就结束了
> app@1.0.0 build
> npm run build:h5
> app@1.0.0 build:h5
> cross-env NODE_ENV=production UNI_PLATFORM=h5 vue-cli-service uni-build
Done in 2.25s.
查看系统信息,如下:发现@vue/cli: Not Found
> app@1.0.0 info
> node node_modules/@dcloudio/vue-cli-plugin-uni/commands/info.js
uni-app v3.1.22
uni-app cli v2.0.0-31920210709003
Environment Info:
System:
OS: Windows 10
CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Binaries:
Node: 16.17.0 - D:\nodejs\node.EXE
Yarn: 1.22.19 - ~\AppData\Roaming\npm\yarn.CMD
npm: 8.15.0 - D:\nodejs\npm.CMD
Browsers:
Edge: 44.22000.120.0
npmPackages:
@dcloudio/types: * => 2.4.4
@dcloudio/uni-app-plus: ^2.0.0-31920210709003 => 2.0.0-31920210709003
@dcloudio/uni-app-plus-nvue: 0.0.1
@dcloudio/uni-app-plus-nvue-v8: 0.0.1
@dcloudio/uni-automator: ^2.0.0-31920210709003 => 2.0.0-31920210709003
@dcloudio/uni-cli-shared: ^2.0.0-31920210709003 => 2.0.0-31920210709003
@dcloudio/uni-h5: ^2.0.0-31920210709003 => 2.0.0-31920210709003
@dcloudio/uni-helper-json: * => 1.0.13
@dcloudio/uni-i18n: ^2.0.0-31920210709003 => 2.0.0-31920210709003
@dcloudio/uni-migration: ^2.0.0-31920210709003 => 2.0.0-31920210709003
@dcloudio/uni-mp-360: ^2.0.0-31920210709003 => 2.0.0-31920210709003
@dcloudio/uni-mp-alipay: ^2.0.0-31920210709003 => 2.0.0-31920210709003
@dcloudio/uni-mp-baidu: ^2.0.0-31920210709003 => 2.0.0-31920210709003
@dcloudio/uni-mp-kuaishou: ^2.0.0-31920210709003 => 2.0.0-31920210709003
@dcloudio/uni-mp-qq: ^2.0.0-31920210709003 => 2.0.0-31920210709003
@dcloudio/uni-mp-toutiao: ^2.0.0-31920210709003 => 2.0.0-31920210709003
@dcloudio/uni-mp-vue: ^2.0.0-31920210709003 => 2.0.0-31920210709003
@dcloudio/uni-mp-weixin: ^2.0.0-31920210709003 => 2.0.0-31920210709003
@dcloudio/uni-quickapp-native: ^2.0.0-31920210709003 => 2.0.0-31920210709003
@dcloudio/uni-quickapp-webview: ^2.0.0-31920210709003 => 2.0.0-31920210709003
@dcloudio/uni-stat: ^2.0.0-31920210709003 => 2.0.0-31920210709003
@dcloudio/uni-template-compiler: ^2.0.0-31920210709003 => 2.0.0-31920210709003
@dcloudio/vue-cli-plugin-hbuilderx: ^2.0.0-31920210709003 => 2.0.0-31920210709003
@dcloudio/vue-cli-plugin-uni: ^2.0.0-31920210709003 => 2.0.0-31920210709003
@dcloudio/vue-cli-plugin-uni-optimize: ^2.0.0-31920210709003 => 2.0.0-31920210709003
@dcloudio/webpack-uni-mp-loader: ^2.0.0-31920210709003 => 2.0.0-31920210709003
@dcloudio/webpack-uni-nvue-loader: 0.0.1
@dcloudio/webpack-uni-pages-loader: ^2.0.0-31920210709003 => 2.0.0-31920210709003
@hap-toolkit/dsl-vue: 0.6.13
@vue/babel-helper-vue-jsx-merge-props: 1.2.1
@vue/babel-plugin-transform-vue-jsx: 1.2.1
@vue/babel-preset-app: 3.12.1
@vue/babel-preset-jsx: 1.2.4
@vue/babel-sugar-composition-api-inject-h: 1.2.1
@vue/babel-sugar-composition-api-render-instance: 1.2.4
@vue/babel-sugar-functional-vue: 1.2.2
@vue/babel-sugar-inject-h: 1.2.2
@vue/babel-sugar-v-model: 1.2.3
@vue/babel-sugar-v-on: 1.2.3
@vue/cli-overlay: 3.12.1
@vue/cli-plugin-babel: ^3.12.1 => 3.12.1
@vue/cli-service: ^3.12.1 => 3.12.1
@vue/cli-shared-utils: 3.12.1
@vue/component-compiler-utils: 3.2.2 (3.2.2)
@vue/preload-webpack-plugin: 1.1.2
@vue/shared: ^3.0.0 => 3.1.5
@vue/web-component-wrapper: 1.3.0
mpvue-page-factory: 1.0.1
mpvue-template-compiler: 1.0.13
uni-h5-vue: 2.6.10
uni-mp-vue: 2.6.10
vue: ^2.6.14 => 2.6.14
vue-hot-reload-api: 2.3.4
vue-loader: 15.9.8 (15.9.8)
vue-router: 3.0.1
vue-style-loader: 4.1.3 (4.1.3)
vue-template-compiler: ^2.6.14 => 2.6.14 (2.6.14)
vue-template-es2015-compiler: 1.9.1
vuex: ^3.6.2 => 3.6.2
npmGlobalPackages:
@vue/cli: Not Found
本机已确认安装了cli环境,执行 vue -V
@vue/cli 4.5.19
我爱娃哈哈 (作者)
@vue/cli是全局安装的,然后build和vue -V是在同一个终端命令行执行的
2022-12-13 20:45
DCloud_UNI_WZF
回复 我爱娃哈哈: 如何创建的项目,运行的 npm run build:h5 吗,build 后 dist/build 下没有 h5 文件夹?
2022-12-13 21:12
我爱娃哈哈 (作者)
回复 DCloud_UNI_WZF: 很老的一个项目了,在mac下是可以正常编译的。转win下就无法编译,执行build之后,任务就直接结束了
2022-12-13 22:22
DCloud_UNI_WZF
回复 我爱娃哈哈: 检查下依赖呢
2022-12-14 09:56