npm ERR! gyp ERR! not ok error해결하기

maliethy·2021년 10월 30일
0

etc

목록 보기
2/9

1. issue

npm ERR! code 1
npm ERR! path /Users/juyoungjung/Desktop/ymillonga-sns/react-query/back/node_modules/bcrypt
npm ERR! command failed
npm ERR! command sh -c node-gyp rebuild
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@7.1.2
npm ERR! gyp info using node@15.14.0 | darwin | arm64
npm ERR! gyp info find Python using Python version 3.8.2 found at "/Applications/Xcode.app/Contents/Developer/usr/bin/python3"
npm ERR! gyp info spawn /Applications/Xcode.app/Contents/Developer/usr/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   '/Users/juyoungjung/.nvm/versions/node/v15.14.0/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args   'binding.gyp',
npm ERR! gyp info spawn args   '-f',
npm ERR! gyp info spawn args   'make',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/Users/juyoungjung/Desktop/ymillonga-sns/react-query/back/node_modules/bcrypt/build/config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/Users/juyoungjung/.nvm/versions/node/v15.14.0/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/Users/juyoungjung/Library/Caches/node-gyp/15.14.0/include/node/common.gypi',
npm ERR! gyp info spawn args   '-Dlibrary=shared_library',
npm ERR! gyp info spawn args   '-Dvisibility=default',
npm ERR! gyp info spawn args   '-Dnode_root_dir=/Users/juyoungjung/Library/Caches/node-gyp/15.14.0',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/Users/juyoungjung/.nvm/versions/node/v15.14.0/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=/Users/juyoungjung/Library/Caches/node-gyp/15.14.0/<(target_arch)/node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=/Users/juyoungjung/Desktop/ymillonga-sns/react-query/back/node_modules/bcrypt',
npm ERR! gyp info spawn args   '-Dnode_engine=v8',
npm ERR! gyp info spawn args   '--depth=.',
npm ERR! gyp info spawn args   '--no-parallel',
npm ERR! gyp info spawn args   '--generator-output',
npm ERR! gyp info spawn args   'build',
npm ERR! gyp info spawn args   '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp: Undefined variable module_name in binding.gyp while trying to load binding.gyp
npm ERR! gyp ERR! configure error 
npm ERR! gyp ERR! stack Error: `gyp` failed with exit code: 1
npm ERR! gyp ERR! stack     at ChildProcess.onCpExit (/Users/juyoungjung/.nvm/versions/node/v15.14.0/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:369:20)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
npm ERR! gyp ERR! System Darwin 20.3.0
npm ERR! gyp ERR! command "/Users/juyoungjung/.nvm/versions/node/v15.14.0/bin/node" "/Users/juyoungjung/.nvm/versions/node/v15.14.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd /Users/juyoungjung/Desktop/ymillonga-sns/react-query/back/node_modules/bcrypt
npm ERR! gyp ERR! node -v v15.14.0
npm ERR! gyp ERR! node-gyp -v v7.1.2
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/juyoungjung/.npm/_logs/2021-10-30T15_04_04_193Z-debug.log

2. solution

에러 메세지 중

npm ERR! path /Users/juyoungjung/Desktop/ymillonga-sns/react-query/back/node_modules/bcrypt

에서 힌트를 얻어 package.json 에서 bcrypt를 지우고 npm install 한 뒤 bcrypt를 따로 npm i bcrypt --save 로 설치했더니 해결되었다.

  "dependencies": {
    "aws-sdk": "^2.811.0",
    "bcrypt": "^5.0.1",
    ...
    }
profile
바꿀 수 있는 것에 주목하자

0개의 댓글