Node Sass 尚不支持您当前的环境:具有不受支持的运行时的 Windows 64 位



我在使用 nodejs 时遇到了一些问题。我总是使用 nodejs 来使用 gulp 和 sass 来用于我的 HTML 项目。 在出现以下错误之前从未遇到过问题:Node Sass 尚不支持您当前的环境:Windows 64 位,运行时不受支持 (57(。我已经全局安装了 npm:npm -g install gulp。然后我总是可以输入gulp,然后我的HTML页面工作了,但现在我得到上述错误。

我做错了什么?

PS:希望我能很好地使用堆栈溢出,这是我的第一个问题,所以如果我做错了,请道歉.....

运行此命令来解决此问题。

npm rebuild node-sass

如果这不起作用,请使用以下内容:

npm rebuild node-sass --force

我想你的节点版本可能高于节点js 9

下面堆栈跟踪的链接帮助我解决了这个问题。

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.问题解决了。

在路径中使用python 2.7.*而不是3.*,然后重新安装node-sassnpm uninstall node-sass && npm install node-sass对我有用,如其他主题中所述。

因此,检查您的python --version可能是开始的事情。

最新更新