它使用 ionic serve
正确启动浏览器模拟器.
但是,gulp watch
在此异常上崩溃...
/node_modules/gulp-sass/node_modules/node-sass/lib/index.js:22
throw new Error('`libsass` bindings not found. Try reinstalling `node-sass`?');
^
Error: `libsass` bindings not found. Try reinstalling `node-sass`?
奇怪的是
npm rebuild node-sass
因此错误而绊倒自己gyp: .node-gyp/4.1.2/common.gypi not found
该问题已在此处讨论,建议
npm@2.14.4
解决了这个问题。https://github.com/brianc/node-pg-native/issues/27
但是,我正在运行
npm@2.14.6
.我必须在这里或第 27 期忽略一些微不足道的事情。谁能看到它是什么?
最佳答案
更新:grunt-sass
可能会出现类似问题.
我通过从 gulp
中删除版本限制来修复它, gulp-sass
并重新安装模块:
“本地”安装的模块)
package.json
, 替换 gulp
旁边的版本号和 gulp-sass
与 "*"
. node-gyp
和 node-sass
到依赖项,还有 "*"
. npm install
作为指南,您可以使用 this stackoverflow link关于更新依赖项。
基本上你需要确保 gulp-sass 使用 node-gyp + node-sass 而不是 pangyp。
我想开始我的第一个
node
项目处于一个干净的状态,所以在这个问题上挣扎了一段时间。降级没用。The problem seemed a conflict with the forced versioning of
gulp-sass
inpackage.json
.gulp-sass
probably relied onpangyp
instead ofnode-gyp
at some point and now thatpangyp
is depreciated, it somehow causes a conflict.
我相信这些版本可以保护您,尤其是在生产中。根据我的经验,(现在大约 1 周)更新项目使用的一些模块并不是那么冒险。
关于npm - .node-gyp/4.1.2/common.gypi 未找到,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33068594/