GYP MAKE上的NPM安装失败:错误:`MAKE`失败,退出代码:2

GYP MAKE上的NPM安装失败:错误:`MAKE`失败,退出代码:2,npm,node-gyp,libtool,libxml-js,Npm,Node Gyp,Libtool,Libxml Js,我们最近接管了一个网站,现在面临更新SASS的问题。运行npm安装时会抛出一堆错误 重建Gyp时,出现了一些问题,该过程中止 我浏览了许多不同的帖子,并尝试了以下内容: 以sudo的身份运行 删除.node gyp并重新运行npm安装 确保加载了正确的libtool我使用的是MAMP提供的libtool,/usr/bin中的libtool在执行时会出现更多错误我不使用macports 将XCode更新至最新版本 确保brew不会像中那样干扰 已将NPM&node更新为最新版本,并确保我的路径中没

我们最近接管了一个网站,现在面临更新SASS的问题。运行npm安装时会抛出一堆错误

重建Gyp时,出现了一些问题,该过程中止

我浏览了许多不同的帖子,并尝试了以下内容:

以sudo的身份运行 删除.node gyp并重新运行npm安装 确保加载了正确的libtool我使用的是MAMP提供的libtool,/usr/bin中的libtool在执行时会出现更多错误我不使用macports 将XCode更新至最新版本 确保brew不会像中那样干扰 已将NPM&node更新为最新版本,并确保我的路径中没有与中相同的空格 同时,我使用以下节点版本对此进行了测试:

节点v7.4.0+npm v4.0.5 节点v6.9.4+npm v3.10.10 节点v4.6+npm v3.1.8.10 节点v0.12.18+npm v2.15.11 节点v0.11.13+npm v1.4.9 这些都不起作用

以下是在我的终端中生成的错误代码:

--- themes/the_theme ‹master* M?› » sudo npm install
Password:
npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue

> libxmljs@0.8.1 install /Users/pietermathys/Sites/sitename/sites/sitename/themes/the_theme/node_modules/libxmljs
> node-gyp rebuild

  CC(target) Release/obj.target/libxml/vendor/libxml/buf.o
  CC(target) Release/obj.target/libxml/vendor/libxml/catalog.o
  CC(target) Release/obj.target/libxml/vendor/libxml/chvalid.o
  CC(target) Release/obj.target/libxml/vendor/libxml/dict.o
  CC(target) Release/obj.target/libxml/vendor/libxml/encoding.o
  CC(target) Release/obj.target/libxml/vendor/libxml/entities.o
  CC(target) Release/obj.target/libxml/vendor/libxml/error.o
  CC(target) Release/obj.target/libxml/vendor/libxml/globals.o
  CC(target) Release/obj.target/libxml/vendor/libxml/hash.o
  CC(target) Release/obj.target/libxml/vendor/libxml/HTMLparser.o
  CC(target) Release/obj.target/libxml/vendor/libxml/HTMLtree.o
  CC(target) Release/obj.target/libxml/vendor/libxml/legacy.o
  CC(target) Release/obj.target/libxml/vendor/libxml/list.o
  CC(target) Release/obj.target/libxml/vendor/libxml/parser.o
../vendor/libxml/parser.c:13492:43: warning: passing 'const xmlChar *' (aka 'const unsigned char *') to parameter of type 'const char *' converts between pointers to integer types with different sign [-Wpointer-sign]
        hdlr = xmlFindCharEncodingHandler(doc->encoding);
                                          ^~~~~~~~~~~~~
../vendor/libxml/include/libxml/encoding.h:175:42: note: passing argument to parameter 'name' here
        xmlFindCharEncodingHandler      (const char *name);
                                                     ^
1 warning generated.
  CC(target) Release/obj.target/libxml/vendor/libxml/parserInternals.o
  CC(target) Release/obj.target/libxml/vendor/libxml/pattern.o
  CC(target) Release/obj.target/libxml/vendor/libxml/relaxng.o
  CC(target) Release/obj.target/libxml/vendor/libxml/SAX2.o
  CC(target) Release/obj.target/libxml/vendor/libxml/SAX.o
  CC(target) Release/obj.target/libxml/vendor/libxml/tree.o
  CC(target) Release/obj.target/libxml/vendor/libxml/threads.o
  CC(target) Release/obj.target/libxml/vendor/libxml/uri.o
  CC(target) Release/obj.target/libxml/vendor/libxml/valid.o
  CC(target) Release/obj.target/libxml/vendor/libxml/xinclude.o
  CC(target) Release/obj.target/libxml/vendor/libxml/xlink.o
  CC(target) Release/obj.target/libxml/vendor/libxml/xmlIO.o
  CC(target) Release/obj.target/libxml/vendor/libxml/xmlmemory.o
  CC(target) Release/obj.target/libxml/vendor/libxml/xmlmodule.o
  CC(target) Release/obj.target/libxml/vendor/libxml/xmlreader.o
  CC(target) Release/obj.target/libxml/vendor/libxml/xmlregexp.o
  CC(target) Release/obj.target/libxml/vendor/libxml/xmlsave.o
  CC(target) Release/obj.target/libxml/vendor/libxml/xmlschemas.o
../vendor/libxml/xmlschemas.c:24203:10: warning: explicitly assigning value of variable of type 'xmlSchemaValType' to itself [-Wself-assign]
        valType = valType;
        ~~~~~~~ ^ ~~~~~~~
1 warning generated.
  CC(target) Release/obj.target/libxml/vendor/libxml/xmlschemastypes.o
  CC(target) Release/obj.target/libxml/vendor/libxml/xmlstring.o
  CC(target) Release/obj.target/libxml/vendor/libxml/xmlunicode.o
  CC(target) Release/obj.target/libxml/vendor/libxml/xmlwriter.o
  CC(target) Release/obj.target/libxml/vendor/libxml/xpath.o
../vendor/libxml/xpath.c:12402:13: warning: comparison of constant 'XML_NAMESPACE_DECL' (18) with expression of type 'xmlXPathTypeVal' is always false [-Wtautological-constant-out-of-range-compare]
                        if (type == XML_NAMESPACE_DECL)
                            ~~~~ ^  ~~~~~~~~~~~~~~~~~~
In file included from ../vendor/libxml/xpath.c:185:
../vendor/libxml/trionan.c:194:1: warning: unused function 'trio_is_special_quantity' [-Wunused-function]
trio_is_special_quantity
^
../vendor/libxml/trionan.c:218:1: warning: unused function 'trio_is_negative' [-Wunused-function]
trio_is_negative
^
3 warnings generated.
  CC(target) Release/obj.target/libxml/vendor/libxml/xpointer.o
  LIBTOOL-STATIC Release/xml.a
libtool: unrecognized option `-static'
libtool: Try `libtool --help' for more information.
make: *** [Release/xml.a] 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:276:23)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Darwin 16.0.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/pietermathys/Sites/sitename/sites/sitename/themes/the_theme/node_modules/libxmljs
gyp ERR! node -v v6.9.4
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok 
theaim@2.0.2 /Users/pietermathys/Sites/sitename/sites/sitename/themes/the_theme
└── (empty)

npm WARN theaim@2.0.2 No description
npm WARN theaim@2.0.2 No repository field.
npm WARN theaim@2.0.2 No license field.
npm ERR! Darwin 16.0.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install"
npm ERR! node v6.9.4
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE

npm ERR! libxmljs@0.8.1 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the libxmljs@0.8.1 install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the libxmljs 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 information on how to open an issue for this project with:
npm ERR!     npm bugs libxmljs
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls libxmljs
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/pietermathys/Sites/sitename/sites/sitename/themes/the_theme/npm-debug.log
npm ERR! code 1

我觉得我已经用尽了我的大部分选择,但我仍然没有看到它。我希望有人能对此有所了解。

解决方案似乎是将以下几点结合起来:

确保哪个libtool指向/usr/bin/libtool 确保xcode已更新 使用NVM+节点v0.10.48 重新安装节点sass和grunt cli 重新运行npm安装 咕哝
您尝试使用最新版本的node 7.4和npm v4.x.x来实现这一点吗?我刚刚尝试了不同版本的node和npm,看看是否可以让它正常工作。我用过NVM。节点7.4+npm 4.0.5也不起作用。相同的错误输出。