[email protected] dev:mp-weixin: `cross-env NODE_ENV=development UNI_PLATFORM=mp-weixin vue-cli-serv

BUG重现:

 ERROR  Failed to compile with 1 error                                                                       下午4:52:42

 error  in ./src/pages/index/index2.vue?vue&type=style&index=0&lang=scss&

TypeError: this.getOptions is not a function


 @ ./src/pages/index/index2.vue?vue&type=style&index=0&lang=scss& 1:0-840 1:856-859 1:861-1698 1:861-1698
 @ ./src/pages/index/index2.vue
 @ ./src/main.js?{"page":"pages%2Findex%2Findex2"}

 ERROR  Build failed with errors.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! my-project@0.1.0 dev:mp-weixin: `cross-env NODE_ENV=development UNI_PLATFORM=mp-weixin vue-cli-service uni-build --watch`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the my-project@0.1.0 dev:mp-weixin 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\MECHREV\AppData\Roaming\npm-cache\_logs\2021-03-02T08_52_42_319Z-debug.log

问题分析:由于sass和sass-loader版本过高或版本不相符导致不兼容,
解决方案:输入以下命令即可解决

npm i node-sass@4.14.1 sass-loader@7.3.1

你可能感兴趣的:(小程序,sass,npm,前端,javascript,html5)