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

查看:232
本文介绍了在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下使用节点v0.12.2.

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

P.S .:我已经尝试重新安装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天全站免登陆