npm - .node-gyp/4.1.2/common.gypi 未找到

标签 npm gulp ionic

它使用 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并重新安装模块:

  • 移动/删除项目的 node_modules 文件夹中的所有模块(
    “本地”安装的模块)
  • package.json , 替换 gulp 旁边的版本号和 gulp-sass"*" .
  • (不需要步骤)为了更好的测量,添加 node-gypnode-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 in package.json. gulp-sass probably relied on pangyp instead of node-gyp at some point and now that pangyp is depreciated, it somehow causes a conflict.



    我相信这些版本可以保护您,尤其是在生产中。根据我的经验,(现在大约 1 周)更新项目使用的一些模块并不是那么冒险。

    关于npm - .node-gyp/4.1.2/common.gypi 未找到,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33068594/

    相关文章:

    npm - 共享使用 npm 链接的项目

    javascript - 一旦将 angular2 应用程序与 gulp 捆绑在一起,如何在 apache http 服务器上进行部署

    ionic-framework - 如何检测对 ionic 项目内元素的点击?

    css - 相当于iOS模拟器Safari中右键 'inspect element'?

    node.js - NPM:命令行 Node 工具的模块安装?

    node.js - npm 更新在 docker 中失败

    npm - Electron package 机: Unable to create OSX package “The strict-ssl parameter is deprecated, use download.strictSSL…”

    css - 如何使用 gulp 仅将引用的 .css 复制到目标?

    Gulp 使用 imagemin 优化图像

    ios - Cordova : pause event doesn't fire when receiving a phone call on iphone