运行gulp dist时找不到libsass绑定 [英] libsass bindings not found when running gulp dist

查看:188
本文介绍了运行gulp dist时找不到libsass绑定的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在我的Linux机器上使用gulp项目。该项目的自述文件告诉我首先运行 sudo npm install -g gulp bower ,然后在项目目录中运行 sudo npm install 然后 bower install 。到目前为止,所有的东西都适合我。然后,我尝试运行 gulp dist 并得到这个错误:

 错误:在/ [PROJECT DIRECTORY] /trunk/node_modules/gulp-sass/node_modules/node-sass/vendor/linux-x64-14/binding.node中未找到`libsass`绑定。试着重新安装`node-sass`? 

使用搜索错误产生这个:在nodejs中使用node-sass时未找到libsass绑定,我试过了,但没有解决任何问题。当我查看gulp所说的那个目录时,它找不到差别是 linux-x64-14 ,我说 linux-x64-11 ,所以我假设我有错误的版本?为了好玩,我决定尝试将该文件夹的名称更改为想要的名称,但我得到了另一个错误:

 错误:模块没有自行注册。 

关于这一切的奇怪之处在于,当我尝试在Windows计算机上运行此项目时,我没有任何这些问题,它只是工作。我不知道我在做什么错误,有什么想法?解析方案

它使用下面的命令为我工作。尝试一下

npm重建节点-sas s

  rm -rf node_modules 

npm i


I'm trying to use a gulp project on my Linux machine. The readme for the project tells me to first run sudo npm install -g gulp bower, then in the project directory run sudo npm install and then bower install. Everything up to this point works just fine for me. However, after that I try to run gulp dist and get this error:

Error: `libsass` bindings not found in /[PROJECT DIRECTORY]/trunk/node_modules/gulp-sass/node_modules/node-sass/vendor/linux-x64-14/binding.node. Try reinstalling `node-sass`?

Googling that error produced this: libsass bindings not found when using node-sass in nodejs, which I tried, but that didn't fix anything. When I looked through that directory that gulp said it couldn't find the difference was the linux-x64-14, mine said linux-x64-11, so I'm assuming I have the wrong version? Just for fun I decided to try changing the name of that folder to what it wanted, and I got a different error:

Error: Module did not self-register.

The really strange thing about all this is that when I tried getting this project working on my Windows machine I didn't have any of these issues, it just worked. I have no idea what I'm doing wrong, any ideas?

解决方案

It worked for me using below commands. Try it

npm rebuild node-sass

rm -rf node_modules

npm i

这篇关于运行gulp dist时找不到libsass绑定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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