问题描述
我想在我的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绑定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!