在 nodejs 中使用 node-sass 时找不到 libsass 绑定 [英] libsass bindings not found when using node-sass in nodejs

查看:43
本文介绍了在 nodejs 中使用 node-sass 时找不到 libsass 绑定的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的 node.js v0.12 应用程序中使用 node-sass 模块以从 libsass 的性能中受益.
我执行了 npm i node-sass 来安装模块,到目前为止没有错误.

I want to use the node-sass module in my node.js v0.12 application to benefit from the performance of libsass.
I executed npm i node-sass to install the module, no errors so far.

现在混乱开始了:
如果我只是在终端中打开 REPL 来尝试 node-sass 然后一切正常,但是如果我将它包含在我的项目文件中并运行 node myfile.js 然后我收到以下错误消息:

Now the mess starts:
If I just open the REPL in a terminal to try out node-sass then everything works fine but if I include it in my project files and run node myfile.js then I get the following error message:

Error: `libsass` bindings not found. Try reinstalling `node-sass`?

npmjs.com 上的模块说明指出解析 可能存在问题#!/usr/bin/env node 在 Ubuntu 下以及如何解决这个问题,但在我的机器上不是这种情况.
我找不到任何有用的东西,所以我希望你能帮助我.

The module's description at npmjs.com states that there might be a problem with resolving #!/usr/bin/env node under Ubuntu and how to fix this but that is not the case on my machine.
I could not find anything useful so I hope that you might help me.

我在 Ubuntu 14.10 下使用 node v0.12.2.

I'm using node v0.12.2 under Ubuntu 14.10.

PS:我已经尝试重新安装 node-sass 但没有成功.没有任何变化.

P.S.: I already tried to reinstall node-sass but without success. Nothing changes.

推荐答案

您可能在使用

npm install node-sass

npm uninstall node-sass
npm install node-sass

但是 node-sass 是 Sass 的 C 版本.您必须使用 npm 重建:

But node-sass is a C version of Sass. You have to use npm rebuild:

npm rebuild node-sass

这篇关于在 nodejs 中使用 node-sass 时找不到 libsass 绑定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆