node.js - 更新 NodeJS 后使用 node-sass 的问题

标签 node.js node-sass

更新我的 NodeJS 版本后,我在使用 node-sass 时遇到问题。

问题:

(node:472) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
C:\aglqng\src\main\webapp\node_modules\node-sass\lib\index.js:15
    throw new Error(errors.missingBinary());
    ^

Error: Missing binding C:\aglqng\src\main\webapp\node_modules\node-sass\vendor\win32-x64-48\binding.node
Node Sass could not find a binding for your current environment: Windows 64-bit with Node.js 6.x

Found bindings for the following environments:
  - Windows 64-bit with Node 0.12.x

This usually happens because your environment has changed since running `npm install`.
Run `npm rebuild node-sass` to build the binding for your current environment.
    at Object.<anonymous> (C:\aglqng\src\main\webapp\node_modules\node-sass\lib\index.js:15:11)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:458:32)
    at tryModuleLoad (module.js:417:12)
    at Function.Module._load (module.js:409:3)
    at Module.require (module.js:468:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (C:\aglqng\src\main\webapp\node_modules\gulp-sass\index.js:187:21)
    at Module._compile (module.js:541:32)

版本:

node-sass 3.8.0 (Wrapper) [JavaScript]
libsass 3.3.6 (Sass Compiler) [C/C++]
nodejs v6.3.1

平台: Windows 10 x64

我试过了,还是不行:

1)

node rebuild node-sass

2)

npm uninstall node-sass
npm i node-sass

最佳答案

我可以通过运行这个命令来解决这个问题:

npm install node-sass

关于node.js - 更新 NodeJS 后使用 node-sass 的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38652404/

相关文章:

javascript - 如何使用socket_id单独发送给客户端?

pipe - 如何将node-sass的输出获取到postcss autoprefixer

css - Node-Sass 将单个目录中的多个文件编译为一个文件

node.js - 使用 node-sass 和 Node.js 将 scss 编译为 css

javascript - 使用 npm 脚本编译 sass - node-sass 返回 EISDIR : illegal operation on a directory

sass - 有没有办法在 Nuxt.js 中使用 sass 而不是 node-sass (sass-loader 的默认值)?

javascript - 如何从 Express 中间件作为单独的模块返回值

node.js - 流量高峰

javascript - Node.js 在循环和处理对象数组时异步丢失上下文

node.js - Nest Js (Node Js Framework) - 如何使用 pm2 在 Digital Ocean 上启动服务器?