正准备学 ionic,然后各种问题,貌似都是因为 node 版本太新了?
Error: `libsass` bindings not found. Try reinstalling `node-sass`?
尝试的解决方案是跟着 sass 官方教程:Building on Mac OS X做的,但依然出现同样的错误提示。 我知道我肯定已经装了 libsass 的,但 binding 这是怎么设置? export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig 也是设置过了的。
而且
npm ls node-sass
[email protected] /Users/yebiying/Code/a_project
└─┬ [email protected]
└── [email protected]
gyp ERR! stack Error: `make` failed with exit code: 2
完整版本是
make: *** [Release/obj.target/contextify/src/contextify.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:270:23)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Darwin 14.3.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/yebiying/Code/a_project/node_modules/contextify
gyp ERR! node -v v4.1.1
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
npm ERR! Darwin 14.3.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "contextify"
npm ERR! node v4.1.1
npm ERR! npm v2.14.4
npm ERR! code ELIFECYCLE
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the contextify package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls contextify
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/yebiying/Code/a_project/npm-debug.log
乱七八糟试了很多,比如什么
sudo npm i -g node-inspector --unsafe-perm
npm install contextify
但这个帖子有人说『there appears to be an issue with the subdependency contextify installing on node v4. 』好吧,看来版本太新就是坑啊!
要不我还是暂时先卸载 v4.1.1,用回 v0.12.7 吧……好惨…… 呜呜呜,再也不随便升级了……