【问题标题】:Error: Node Sass does not yet support your current environment: OS X 64-bit with Unsupported runtime (72)错误:Node Sass 尚不支持您当前的环境:OS X 64-bit with Unsupported runtime (72)
【发布时间】:2020-11-23 18:32:26
【问题描述】:

我使用的是 macOS Catalina 10.15.3。

我正在用这个Jekyll theme 生成缩略图,当我输入gulp img 时,就会出现这个错误。

Requiring external module babel-register
~/node_modules/node-sass/lib/binding.js:13
      throw new Error(errors.unsupportedEnvironment());
      ^

Error: Node Sass does not yet support your current environment: OS X 64-bit with Unsupported runtime (72)
For more information on which environments are supported please see:
https://github.com/sass/node-sass/releases/tag/v4.7.1
    at module.exports (~/node_modules/node-sass/lib/binding.js:13:13)
    at Object.<anonymous> (~/node_modules/node-sass/lib/index.js:14:35)
    at Module._compile (internal/modules/cjs/loader.js:1157:30)
    at Module._extensions..js (internal/modules/cjs/loader.js:1177:10)
    at Object.require.extensions.<computed> [as .js] (~/node_modules/babel-register/lib/node.js:152:7)
    at Module.load (internal/modules/cjs/loader.js:1001:32)
    at Function.Module._load (internal/modules/cjs/loader.js:900:14)
    at Module.require (internal/modules/cjs/loader.js:1043:19)
    at require (internal/modules/cjs/helpers.js:77:18)
    at Object.<anonymous> (~/node_modules/gulp-sass/index.js:187:21)

我尝试了所有方法,例如npm install、npm uninstall、npm rebuild node-sass 等等,但我不知道为什么会出现错误。

【问题讨论】:

  • 你运行的是什么版本的节点? node --version - 看起来您正在运行 Node Sass 的过时版本...您收到的错误消息指向 v4.7.1 的链接 - 但 v4.13.1 是最新版本...另外,@987654323 @人们提出了同样的错误,因为他们提供了解决方案。
  • @MattOestreich 当我运行node --version 时,它说我现在正在使用v12.16.1。
  • 看起来这可能是您正在使用的依赖项之一的问题。See here
  • @MattOestreich 如何找到旧的依赖项并升级它们?
  • 通过文件搜索搜索您的node_modules......

标签: node.js sass


【解决方案1】:

我遇到了同样的问题。对我来说,它有助于重新安装 NodeJs(在我的情况下是 14.15.1 LTS),然后是已经提到的命令:

npm rebuild node-sass

【讨论】:

  • 干得好,我的兄弟。
  • @Samuel,我希望我的回答能帮到你。如果是这样,您可以将我的答案设置为正确。谢谢
猜你喜欢
  • 2019-12-07
  • 2020-05-20
  • 2018-10-22
  • 2021-02-10
  • 2019-04-22
  • 1970-01-01
  • 1970-01-01
  • 2019-02-14
  • 2021-02-15
相关资源
最近更新 更多