1***@qq.com
1***@qq.com
  • 发布:2021-07-22 16:18
  • 更新:2021-07-22 16:18
  • 阅读:1152

cli创建的uniapp项目,能运行 但是不能build

分类:uni-app

//package.json文件

"dependencies": {  
        "@dcloudio/uni-app-plus": "^2.0.0-31820210406002",  
        "@dcloudio/uni-h5": "^2.0.0-31820210406002",  
        "@dcloudio/uni-helper-json": "*",  
        "@dcloudio/uni-i18n": "^2.0.0-31820210406002",  
        "@dcloudio/uni-mp-360": "^2.0.0-31820210406002",  
        "@dcloudio/uni-mp-alipay": "^2.0.0-31820210406002",  
        "@dcloudio/uni-mp-baidu": "^2.0.0-31820210406002",  
        "@dcloudio/uni-mp-kuaishou": "^2.0.0-31820210406002",  
        "@dcloudio/uni-mp-qq": "^2.0.0-31820210406002",  
        "@dcloudio/uni-mp-toutiao": "^2.0.0-31820210406002",  
        "@dcloudio/uni-mp-vue": "^2.0.0-31820210406002",  
        "@dcloudio/uni-mp-weixin": "^2.0.0-31820210406002",  
        "@dcloudio/uni-quickapp-native": "^2.0.0-31820210406002",  
        "@dcloudio/uni-quickapp-webview": "^2.0.0-31820210406002",  
        "@dcloudio/uni-stat": "^2.0.0-31820210406002",  
        "@vue/shared": "^3.0.0",  
        "core-js": "^3.6.5",  
        "cssnano": "^5.0.6",  
        "flyio": "^0.6.2",  
        "mini-css-extract-plugin": "^1.5.0",  
        "postcss": "^8.3.6",  
        "postcss-loader": "^5.2.0",  
        "postcss-merge-rules": "^5.0.2",  
        "regenerator-runtime": "^0.12.1",  
        "uview-ui": "^1.8.4",  
        "vue": "^2.6.11",  
        "vuex": "^3.2.0"  
    },  
    "devDependencies": {  
        "@babel/runtime": "~7.12.0",  
        "@dcloudio/types": "*",  
        "@dcloudio/uni-automator": "^2.0.0-31820210406002",  
        "@dcloudio/uni-cli-shared": "^2.0.0-31820210406002",  
        "@dcloudio/uni-migration": "^2.0.0-31820210406002",  
        "@dcloudio/uni-template-compiler": "^2.0.0-31820210406002",  
        "@dcloudio/vue-cli-plugin-hbuilderx": "^2.0.0-31820210406002",  
        "@dcloudio/vue-cli-plugin-uni": "^2.0.0-31820210406002",  
        "@dcloudio/vue-cli-plugin-uni-optimize": "^2.0.0-31820210406002",  
        "@dcloudio/webpack-uni-mp-loader": "^2.0.0-31820210406002",  
        "@dcloudio/webpack-uni-pages-loader": "^2.0.0-31820210406002",  
        "@ns/enum": "^2.0.0",  
        "@vue/cli-plugin-babel": "~4.5.0",  
        "@vue/cli-service": "~4.5.0",  
        "babel-plugin-import": "^1.11.0",  
        "cross-env": "^7.0.2",  
        "css-loader": "^6.2.0",  
        "jest": "^25.4.0",  
        "less-loader": "5.0.0",  
        "mini-types": "*",  
        "miniprogram-api-typings": "*",  
        "node-sass": "^4.14.1",  
        "postcss-comment": "^2.0.0",  
        "sass-loader": "^7.3.1",  
        "uview-ui": "^1.8.4",  
        "vue-template-compiler": "^2.6.11"  
    },

//终端报错

WARN A new version of sass-loader is available. Please upgrade for best experience.
/ 开始编译当前项目至 h5 平台...

ERROR Failed to compile with 1 error 下午4:12:16
error in ./src/pages/login/index.vue?vue&type=style&index=0&id=80d5b35a&lang=scss&scoped=true&

Syntax Error: TypeError: this.getOptions is not a function

@ ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/h5-vue-style-loader??ref--8-oneOf-1-0!./node_modules/@vue/cli-service/node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--8-oneOf-1-2!./node_modules/postcss-loader/dist/cjs.js??ref--8-oneOf-1-3!./node_modules/@vue/cli-service/node_modules/postcss-loader/src??ref--8-oneOf-1-4!./node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-1-5!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--8-oneOf-1-6!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-scoped-loader!./src/pages/login/index.vue?vue&type=style&index=0&id=80d5b35a&lang=scss&scoped=true& 4:14-941
@ ./src/pages/login/index.vue?vue&type=style&index=0&id=80d5b35a&lang=scss&scoped=true&
@ ./src/pages/login/index.vue
@ ./src/pages.json
@ ./src/main.js
@ multi ./src/main.js

ERROR Build failed with errors.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! drpupu-uniapp@1.0.0 build:h5: cross-env NODE_ENV=production UNI_PLATFORM=h5 vue-cli-service uni-build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the drpupu-uniapp@1.0.0 build:h5 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! C:\Users\zhangzhe\AppData\Roaming\npm-cache_logs\2021-07-22T08_12_16_248Z-debug.log
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

2021-07-22 16:18 负责人:无 分享
已邀请:

该问题目前已经被锁定, 无法添加新回复