运行npm安装时出错:.node-gyp / 6.14.4 / include / node / v8.h:21:10:致命错误:找不到'实用程序'文件

时间:2018-10-23 04:34:06

标签: node.js npm npm-install node-modules node-gyp

我正在为一个节点项目从macOS运行npm install

npm -version 3.10.10 节点-v v6.14.4。

但是,在执行npm安装时,出现以下错误:

**。node-gyp / 6.14.4 / include / node / v8.h:21:10:致命错误:找不到“实用程序”文件

包括**

尝试更新npm版本 npm Unstall和npm install node-gyp npm install -g npm

2 个答案:

答案 0 :(得分:0)

直到一个月前,我的一个项目都工作正常,我遇到了同样的问题。一切都没有改变,现在开发依赖项没有安装/构建。

 "devDependencies": {
    "colors": "^1.1.2",
    "grunt": "1.0.1",
    "grunt-concurrent": "2.3.1",
    "grunt-contrib-clean": "^1.1.0",
    "grunt-contrib-jshint": "^1.1.0",
    "grunt-eslint": "^20.1.0",
    "grunt-fh-build": "2.0.0",
    "grunt-jsxgettext": "1.1.0",
    "grunt-open": "0.2.3",
    "grunt-shell": "2.1.0",
    "grunt-zanata-js": "1.4.1",
    "istanbul": "0.4.5",
    "jsxgettext": "0.8.2",
    "load-grunt-tasks": "3.5.2",
    "nock": "9.0.17",
    "proxyquire": "0.4.1",
    "time-grunt": "1.4.0",
    "turbo-test-runner": "0.3.3"
  },
  

[iltorb]成功:   “ /用户/ camilamacedo /工作/fh-fhc/node_modules/grunt-fh-build/node_modules/iltorb/build/bindings/encode.node”   通过远程安装

     
    

node-expat@2.3.17安装/ Users / camilamacedo / work / fh-fhc / node_modules / node-expat     node-gyp重建

  
     

CC(target)版本/obj.target/expat/deps/libexpat/lib/xmlparse.o
  CC(目标)版本/obj.target/expat/deps/libexpat/lib/xmltok.o
  CC(目标)版本/obj.target/expat/deps/libexpat/lib/xmlrole.o
  LIBTOOL-STATIC版本/libexpat.a CXX(目标)   Release / obj.target / node_expat / node-expat.o警告:包含以下内容的路径   找不到stdlibc ++标头;通过'-std = libc ++'         命令行以使用libc ++标准库代替         [-Wstdlibcxx-notfound]在../node-expat.cc中包含的文件中:1:在../../nan/nan.h中包含的文件中:52:在文件中   来自   /Users/camilamacedo/.node-gyp/6.11.5/include/node/node.h:42:   /Users/camilamacedo/.node-gyp/6.11.5/include/node/v8.h:21:10:致命   错误:         找不到“实用程序”文件

     

包括

     ^~~~~~~~~

答案 1 :(得分:0)

升级到MacOS Mojave(10.14)后,我遇到了同样的问题

假设您使用的Mac版本高于10.7,请将文件 common.gypi

中的密钥 MACOSX_DEPLOYMENT_TARGET 更新为您的操作系统版本。

此修补程序最初是在这里提及的:

https://github.com/nodejs/node-gyp/issues/1574

https://github.com/AlexVentura/node/commit/a80901c79da64fc7ddf0de14542a92700166006f