Node Sass目前不支持您当前的环境:Windows 64位,带有不受支持的运行时。

3
我在使用 nodejs 时遇到了一些问题。我通常使用 nodejs 来为我的 HTML 项目使用 gulp 和 sass。直到出现以下错误,我从未遇到过问题: Node Sass does not yet support your current environment: Windows 64-bit with Unsupported runtime (57). 我已经通过 npm 全局安装了 gulp:npm -g install gulp。然后我总是可以输入gulp 然后我的 HTML 页面就能工作了,但现在我得到了上面的错误信息。
我做错什么了吗?
PS:希望我正确地使用了 stackoverflow,这是我的第一个问题,如果我做错了,请谅解.....

4个回答

4
运行以下命令以解决此问题。
npm rebuild node-sass

如果这不起作用,请使用以下方法:

npm rebuild node-sass --force

1
这个命令对我没用,但是加上 --force 的同样的命令却非常好用! - Wael
2
npm rebuild node-sass --force 终端显示: "我希望你知道自己在做什么。" 我:... - stevec

2
我猜您的 Node.js 版本可能是 9 或以上。

2
以下的堆栈跟踪链接帮助我解决了这个问题。最初的回答。
Module build failed: Error: Node Sass does not yet support your current environment: Windows 64-bit with Unsupported runtime (64)
For more information on which environments are supported please see:
https://github.com/sass/node-sass/releases/tag/v4.7.2

该链接(https://github.com/sass/node-sass/releases/tag/v4.7.2)清楚地显示了支持的节点版本。最初的回答。
    OS      Architecture    Node
    Windows x86 & x64       0.10, 0.12, 1, 2, 3, 4, 5, 6, 7, 8, 9
    ...     ...             ...    

我使用的是node 10.15.3,很明显它不被支持。所以,我将节点版本降级到8.11.1,再次执行npm install。得到以下信息。


Node Sass could not find a binding for your current environment: Windows 64-bit with Node.js 8.x

Found bindings for the following environments:
  - Windows 64-bit with Unsupported runtime (64)

This usually happens because your environment has changed since running `npm install`.
Run `npm rebuild node-sass --force` to build the binding for your current environment.

按照建议,运行npm rebuild node-sass --force。问题得到了解决。

注:Original Answer翻译成"最初的回答"

1

我曾经遇到过与3.*不同的python 2.7.*在路径中,然后重新安装node-sassnpm uninstall node-sass && npm install node-sass,这个方法对我有效,正如其他topic所提到的那样。

因此,检查你的python --version可能是一个开始的地方。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接