无法在离子中安装sass。使用节点v4.2.1 [英] Cannot installing sass in ionic. Using node v4.2.1
问题描述
每当我尝试在离子中设置sass时,我都会收到以下错误
Whenever I try to setup sass in ionic I get the following error
Error: `libsass` bindings not found. Try reinstalling `node-sass`?
我试图像许多论坛中提到的那样重建sass但没有得到任何结果。我正在使用节点v4.2.1
I tried to rebuild sass as mentioned in many forums but get no results. I'm using node v4.2.1
推荐答案
我刚用这个命令解决了libsass或node-sass的问题: / p>
I've just fixed problems with libsass or node-sass with this command:
$ sudo rm -rf node_modules/ && cat package.json | sed -i.bak 's/"gulp-sass": "^X.X.X"/"gulp-sass": "^2.0.4"/g' package.json && npm install && ionic lib update
其中X是package.json中gulp-sass的版本
Where X is the version of gulp-sass in your package.json
说明:
删除node_modules中的旧文件。我不确定是否有必要使用'sudo'(在我的情况下,是的)。
Remove the old files in node_modules. I'm not sure is necessary to use 'sudo' (in my case, yes).
$ sudo rm -rf node_modules/
在package.json内部搜索和替换更新gulp -sass版本到^ 2.0.4。它还会创建一个备份(package.json.bak),
Search and replace inside package.json updating gulp-sass version to ^2.0.4. It also creates a backup (package.json.bak),
$ cat package.json | sed -i.bak 's/"gulp-sass": "^X.X.X"/"gulp-sass": "^2.0.4"/g' package.json
重新安装依赖项
Reinstall dependencies
$ npm install
更新离子库在项目中
Update the ionic lib in the project
ionic lib update
如果您有任何进一步的问题,请确保我尝试可以帮助您...
If you have any further problems be sure I try can help you...
再见
这篇关于无法在离子中安装sass。使用节点v4.2.1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!