티스토리 뷰

개발/Node.js

npm install 에러 - MacOS

Jaeyeon Baek 2020. 3. 26. 09:09

패키지를 다운로드 받아서 npm install 시켰는데 아래와 같은 오류가 발생했다. 

$ npm install
> fsevents@1.2.11 install /Users/jybaek/work/foo/client/node_modules/fsevents
> node-gyp rebuild
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
No receipt for 'com.apple.pkg.CLTools_Executables' found at '/'.
No receipt for 'com.apple.pkg.DeveloperToolsCLILeo' found at '/'.
No receipt for 'com.apple.pkg.DeveloperToolsCLI' found at '/'.
gyp: No Xcode or CLT version detected!
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:336:16)
gyp ERR! stack     at ChildProcess.emit (events.js:160:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:12)
gyp ERR! System Darwin 19.2.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/jybaek/work/foo/client/node_modules/fsevents
gyp ERR! node -v v9.4.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm WARN @material-ui/icons@4.9.1 requires a peer of @material-ui/core@^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @material-ui/icons@4.9.1 requires a peer of @types/react@^16.8.6 but none is installed. You must install peer dependencies yourself.
npm WARN @material-ui/icons@4.9.1 requires a peer of react@^16.8.0 but none is installed. You must install peer dependencies yourself.
npm WARN @material-ui/icons@4.9.1 requires a peer of react-dom@^16.8.0 but none is installed. You must install peer dependencies yourself.
npm WARN jsdom@15.2.1 requires a peer of canvas@^2.5.0 but none is installed. You must install peer dependencies yourself.
npm WARN ws@7.2.1 requires a peer of bufferutil@^4.0.1 but none is installed. You must install peer dependencies yourself.
npm WARN ws@7.2.1 requires a peer of utf-8-validate@^5.0.2 but none is installed. You must install peer dependencies yourself.
npm WARN sass-loader@8.0.2 requires a peer of sass@^1.3.0 but none is installed. You must install peer dependencies yourself.
npm WARN sass-loader@8.0.2 requires a peer of fibers@>= 3.1.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.11 (node_modules/fsevents):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.11 install: `node-gyp rebuild`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
up to date in 14.527s
(base) jybaek:~/work/foo/client$

 

에러를 검색해보면 xcode-select --install 하면 된다는데 ...

$ xcode-select --install
xcode-select: error: command line tools are already installed, 
use "Software Update" to install updates

 

위에 메시지처럼 해결책은 아닌 듯 하다...  Catalina 버전 올라오면서 생긴 문제같은데 xcode-select가 정상적으로 동작 안되는건지 충돌이 있는건지 아무튼 문제가 있기는 하다. 그렇다면 삭제하고 다시 설치하도록 하자.

sudo rm -rf $(xcode-select -print-path)
xcode-select --install

 

이후 정상적으로 npm install 되는 것을 볼 수 있다. 왜 이런 문제가 생기는지는 모르겠지만... 누군가에게는 단비같은 도움이 되었기를.

 

https://github.com/schnerd/d3-scale-cluster/issues/7#issuecomment-550579897

댓글
댓글쓰기 폼