问题概述
前端项目开发完成后,打包编译时报错,“Module build failed: Error: Node Sass does not yet support your current environment: Windows 64-bit with Unsupported runtime”,提示系统的node-sass不被支持的,截图如下:
具体内容如下:
ERROR Failed to compile with 6 errors 下午4:01:38
error in ./src/assets/scss/index.scss
Module build failed: Error: Node Sass does not yet support your current environment: Windows 64-bit with Unsupported runtime (83)
For more information on which environments are supported please see:
https://github.com/sass/node-sass/releases/tag/v4.13.1
at module.exports (E:\code\VSCode_Code\renren-fast-vue\node_modules\node-sass\lib\binding.js:13:13)
at Object.<anonymous> (E:\code\VSCode_Code\renren-fast-vue\node_modules\node-sass\lib\index.js:14:35)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.<anonymous> (E:\code\VSCode_Code\renren-fast-vue\node_modules\sass-loader\lib\loader.js:3:14)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at loadLoader (E:\code\VSCode_Code\renren-fast-vue\node_modules\loader-runner\lib\loadLoader.js:18:17)
@ ./src/assets/scss/index.scss 4:14-212 13:3-17:5 14:22-220
@ ./src/main.js
@ multi (webpack)-dev-server/client?http://localhost:8001 webpack/hot/dev-server babel-polyfill ./src/main.js
error in ./src/views/modules/sys/menu-add-or-update.vue
Module build failed: Error: Node Sass does not yet support your current environment: Windows 64-bit with Unsupported runtime (83)
For more information on which environments are supported please see:
https://github.com/sass/node-sass/releases/tag/v4.13.1
at module.exports (E:\code\VSCode_Code\renren-fast-vue\node_modules\node-sass\lib\binding.js:13:13)
at Object.<anonymous> (E:\code\VSCode_Code\renren-fast-vue\node_modules\node-sass\lib\index.js:14:35)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.<anonymous> (E:\code\VSCode_Code\renren-fast-vue\node_modules\sass-loader\lib\loader.js:3:14)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at loadLoader (E:\code\VSCode_Code\renren-fast-vue\node_modules\loader-runner\lib\loadLoader.js:18:17)
@ ./node_modules/vue-style-loader!./node_modules/css-loader?{"sourceMap":false}!./node_modules/vue-loader/lib/style-compiler?{"vue":true,"id":"data-v-1ed9424a","scoped":false,"hasInlineConfig":false}!./node_modules/sass-loader/lib/loader.js?{"sourceMap":false}!./node_modules/vue-loader/lib/selector.js?type=styles&index=0&bustCache!./src/views/modules/sys/menu-add-or-update.vue
4:14-422 13:3-17:5 14:22-430
@ ./src/views/modules/sys/menu-add-or-update.vue
@ ./src/views ^\.\/.*\.vue$
@ ./src/router/import-development.js
@ ./src/router/index.js
@ ./src/main.js
@ multi (webpack)-dev-server/client?http://localhost:8001 webpack/hot/dev-server babel-polyfill ./src/main.js
error in ./src/views/common/login.vue
Module build failed: Error: Node Sass does not yet support your current environment: Windows 64-bit with Unsupported runtime (83)
For more information on which environments are supported please see:
https://github.com/sass/node-sass/releases/tag/v4.13.1
at module.exports (E:\code\VSCode_Code\renren-fast-vue\node_modules\node-sass\lib\binding.js:13:13)
at Object.<anonymous> (E:\code\VSCode_Code\renren-fast-vue\node_modules\node-sass\lib\index.js:14:35)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.<anonymous> (E:\code\VSCode_Code\renren-fast-vue\node_modules\sass-loader\lib\loader.js:3:14)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at loadLoader (E:\code\VSCode_Code\renren-fast-vue\node_modules\loader-runner\lib\loadLoader.js:18:17)
@ ./node_modules/vue-style-loader!./node_modules/css-loader?{"sourceMap":false}!./node_modules/vue-loader/lib/style-compiler?{"vue":true,"id":"data-v-20137d6c","scoped":false,"hasInlineConfig":false}!./node_modules/sass-loader/lib/loader.js?{"sourceMap":false}!./node_modules/vue-loader/lib/selector.js?type=styles&index=0&bustCache!./src/views/common/login.vue 4:14-397 13:3-17:5 14:22-405
@ ./src/views/common/login.vue
@ ./src/views ^\.\/.*\.vue$
@ ./src/router/import-development.js
@ ./src/router/index.js
@ ./src/main.js
@ multi (webpack)-dev-server/client?http://localhost:8001 webpack/hot/dev-server babel-polyfill ./src/main.js
解决办法
经过BUG的诊断,发现是当前系统下的Node版本过高导致的,
注意编译报错内容提示,当前的node-sass是不被支持的,
再查看错误日志中的一行:https://github.com/sass/node-sass/releases/tag/v4.13.1,如下图:
当前系统的node版本为v4.13.1,如下图:
而当前node-sass支持的最高版本为13,如下图:
所以,最终找到问题的所在了,是因为系统的Node版本过高导致的编译异常,只需要将版本降低到13,在重新build一下node-sass就可以了,输入指令:npm rebuild node-sass即可,
好了,关于 Module build failed: Error: Node Sass does not yet support your current environment: 解决办法 就写到这儿了,如果还有什么疑问或遇到什么问题欢迎扫码提问,也可以给我留言哦,我会一一详细的解答的。
歇后语:“ 共同学习,共同进步 ”,也希望大家多多关注CSND的IT社区。
作 者: | 华 仔 |
联系作者: | who.seek.me@java98k.vip |
来 源: | CSDN (Chinese Software Developer Network) |
原 文: | https://blog.csdn.net/Hello_World_QWP/article/details/113563364 |
版权声明: | 本文为博主原创文章,请在转载时务必注明博文出处! |