npm 설치 종속성을 시도하는 중 npm 문제

npm 설치 종속성을 시도하는 중 npm 문제
[email protected] install /home/ubuntu/blockchainpoc/hlpoc/node_modules/pkcs11js
> node-gyp rebuild

gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/home/ubuntu/blockchainpoc/hlpoc/node_modules/pkcs11js/build'
gyp ERR! System Linux 4.4.0-1060-aws
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/ubuntu/blockchainpoc/hlpoc/node_modules/pkcs11js
gyp ERR! node -v v8.11.2
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/ubuntu/.npm/_logs/2018-06-12T07_38_09_022Z-debug.log
  1. 노드 버전 8.11.2를 사용하고 있습니다.

  2. npm 버전 5.6.0을 사용하고 있습니다.

  3. npm install을 입력할 때 sudo를 사용했습니다.

  4. 다음 명령을 사용하여 완전히 제거하고 다시 설치했습니다.

    sudo apt-get remove nodejs
    sudo apt-get remove npm
    
  5. 캐시를 지우고 인스턴스를 다시 시작했습니다.

답변1

다음을 사용하여 gyp를 설치하여 문제를 해결했습니다.

pip install git+https://chromium.googlesource.com/external/gyp --user

답변2

다음을 사용하여 gyp를 설치해야 합니다.

apt-get install node-gyp

관련 정보