2017-11-29 9 views
1

이 문제는 모든 프로젝트에서 발생하지 않습니다. 특히 npm i (노드 v6.9.4 (npm v5.6.0) <)을 실행하면이 문제가 발생합니다. 확인이) 맞다면 :노드 - gyp 재 작성 문제 컴파일러

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__threading_support:25:11: fatal error: 
      'pthread.h' file not found 
    # include <pthread.h> 

오류 로그 :

12788 verbose stack Error: [email protected] install: `node-gyp rebuild` 
12788 verbose stack Exit status 1 
12788 verbose stack  at EventEmitter.<anonymous> (/Users/tom.firth/.nvm/versions/node/v6.9.4/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:285:16) 
12788 verbose stack  at emitTwo (events.js:106:13) 
12788 verbose stack  at EventEmitter.emit (events.js:191:7) 
12788 verbose stack  at ChildProcess.<anonymous> (/Users/tom.firth/.nvm/versions/node/v6.9.4/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14) 
12788 verbose stack  at emitTwo (events.js:106:13) 
12788 verbose stack  at ChildProcess.emit (events.js:191:7) 
12788 verbose stack  at maybeClose (internal/child_process.js:877:16) 
12788 verbose stack  at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5) 
12789 verbose pkgid [email protected] 
12790 verbose cwd /Users/tom.firth/Sites/the-works 
12791 verbose Darwin 16.7.0 
12792 verbose argv "/Users/tom.firth/.nvm/versions/node/v6.9.4/bin/node" "/Users/tom.firth/.nvm/versions/node/v6.9.4/bin/npm" "i" 
12793 verbose node v6.9.4 
12794 verbose npm v5.6.0 
12795 error code ELIFECYCLE 
12796 error errno 1 
12797 error [email protected] install: `node-gyp rebuild` 
12797 error Exit status 1 
12798 error Failed at the [email protected] install script. 
12798 error This is probably not a problem with npm. There is likely additional logging output above. 
12799 verbose exit [ 1, true ] 

이 두 점의 node-gyp rebuild에 -이 전에 전 세계적으로 설치가 없었어요,하지만 난 그것을 시도하고 없이 동일한 오류가 발생합니다.

은 엑스 코드 9.1을 설치하고 실행 내가 한 :주는 $ xcode-select --install : 제공 npmjs.com/fixing-npm-permissions

$ gcc --version :주는

Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 
Apple LLVM version 9.0.0 (clang-900.0.38) 
Target: x86_64-apple-darwin16.7.0 
Thread model: posix 
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin 

$ which gcc 내가의 단계를 따라 xcode-select: error: command line tools are already installed, use "Software Update" to install updates

: /usr/bin/gcc

node-gyp 문제는 날이 컴파일러에 관련이하지만 난 (BREW 및 nodejs.org를 통해) 엑스 코드와 노드

어떤 도움이나 제안 정말 감사하겠습니다을 다시 설치 한 생각합니다.

편집 : 5.6.0 분명 잘되지 않았기 때문에

나는 NPM 3.10.10을 시도했습니다. 이전에 설치되었지만 문제가 해결되지 않았습니다.

xcode 9.1을 대체하기 위해 xcode 8.2.1을 설치했지만 문제가 해결되지 않았습니다.

답변

1

작동하려면 기본적으로 libtool을 설치해야합니다. 이것은 내가 bcrypt을 사용할 때 가지고 있던 동일한 문제점이었습니다. 그게 작동하지 않는 것 같으면 this을 봐야합니다.

또한 어떤 python 버전이 설치되어 있는지 확인하십시오. 지원되는 버전은 2.7입니다. 최신 3.x는 node-gyp 설명서에 따라 아직 지원되지 않습니다. 이 node Js Workshop gyp에 대한 자세한 내용은이 도움말도해야합니다.

+0

libtool이 이미 설치되었습니다. 파이썬의 기본값은 2.7.10으로 설정됩니다. 노드 js 워크샵을 확인해 드리겠습니다. 감사합니다. – TomFirth

0

나는 해결책이 무엇인지 완전히 모르겠습니다.

  1. xcode 8.2.1 (9.1에서 다운)이 설치되었습니다. 전에 시도했지만 처음에는이 작동하지 않았다.
  2. 나는 수동 ( xcode-select --install하지 통해) (Library/Developer/CommandLineTools 이 설치 이전 또는 이후에 존재하지 않는)을 commandlinetools를 설치 - xcode-select -p 는 디렉토리가 존재하지 않았지만에도 commandlinetools에 Xcode를 가리키는에서 해당 경로를 변경했습니다.
  3. 그런 다음 Xcode8.2를 설치했습니다.1, xcode-select의 경로가 자동으로 재설정 됨 재설정없이 변경됨 (xcode-select --reset)

이 후, 내 문제가 해결되었습니다.

+0

'xcode-select'는 C 컴파일러, 파이썬 라이브러리, 기타 다양한 명령 행 도구와 같이 node-gyp에 필요한 많은 도구를 설치합니다. –