Node Sass does not yet support your current environment: Windows 64-bit with Unsupported runtime(代码片

Posted 尔嵘

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Node Sass does not yet support your current environment: Windows 64-bit with Unsupported runtime(代码片相关的知识,希望对你有一定的参考价值。

一、本地cnpm install安装依赖之后,运行npm run serve 报错,如下:

报错原文:

 ERROR  Failed to compile with 1 error                                                                                                                                                                              上午9:24:42
 error  in ./src/assets/main.scss

Syntax Error: Error: Node Sass does not yet support your current environment: Windows 64-bit with Unsupported runtime (93)
For more information on which environments are supported please see:
https://github.com/sass/node-sass/releases/tag/v4.14.1


 @ ./src/assets/main.scss 4:14-280 15:3-20:5 16:22-288
 @ ./src/main.js
 @ multi ./node_modules/_webpack-dev-server@3.11.3@webpack-dev-server/client?http://192.168.0.119:8080/sockjs-node (webpack)/hot/dev-server.js ./src/main.js

二、分析错误: 

看了报错信息,可能和node.js、node-sass有关,属于依赖环境报错,我决定复制错误提示中的链接:

https://github.com/sass/node-sass/releases/tag/v4.14.1

分析版本:

npm查看node-sass:

 看了package.json中版本确是4.9.0,先删除node-sass

 

 删除node_modules中的node-sass模块

尝试安装了6.0.1,还是不行,自信找找发现其实解决这一问题就是因为node.js版本过高带来的冲突。

三、真正解决

我本地安装的版本如下:

v16.13.0

 

直接去百度查找能够适应node.js16+版本的node-sass和sass-loader的版本:

去package.json中替换成下面的兼容node16+版本:

"devDependencies": {
    "sass-loader": "^10.2.0",
    "node-sass": "^6.0.1",
  },

删除node_modules全部模块,重新cnpm install,再次运行npm run serve,问题解决

效果:

 

 总结:

我的解决办法比网上的可能比较快,你首先确定你的node版本,然后再去看看package.json中node-sass和sass-loader版本是不是低了,低了就直接修改版本号,重新安装。

以上是关于Node Sass does not yet support your current environment: Windows 64-bit with Unsupported runtime(代码片的主要内容,如果未能解决你的问题,请参考以下文章

Syntax Error: Error: Node Sass does not yet support your current environment

Error: Node Sass does not yet support your current environment: Windows 64-bit with Unsupported runt

Node Sass does not yet support your current environment: Linux 64-bit with Unsupported runtime

Error: Node Sass does not yet support your current environment: Windows 64-bit with Unsupported runt

启动项目时出现Error: Node Sass does not yet support your current environment: Windows 64-bit with Unsupport

Node Sass does not yet support your current environment: Windows 64-bit with Unsupported runtime(代码片