npm установка не удалась при bcrypt@3.0.7 установке - PullRequest
0 голосов
/ 12 января 2020

Я пытаюсь установить пакет verdaccio-bitbucket npm.

$ npm install -g verdaccio-bitbucket

при локальной установке на мою ма c, она работает без ошибок.

Когда я запускаю это на AWS Linux 2 AMI, я получаю следующее:

[ec2-user@ip-9-9-0-76 verdaccio]$ npm install -g verdaccio-bitbucket                                                                                                                                                           

> bcrypt@3.0.7 install /home/ec2-user/.nvm/versions/node/v13.6.0/lib/node_modules/verdaccio-bitbucket/node_modules/bcrypt
> node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using needle for node-pre-gyp https download 
node-pre-gyp WARN Tried to download(404): https://github.com/kelektiv/node.bcrypt.js/releases/download/v3.0.7/bcrypt_lib-v3.0.7-node-v79-linux-x64-glibc.tar.gz 
node-pre-gyp WARN Pre-built binaries not found for bcrypt@3.0.7 and node@13.6.0 (node-v79 ABI, glibc) (falling back to source compile with node-gyp) 
make: Entering directory `/home/ec2-user/.nvm/versions/node/v13.6.0/lib/node_modules/verdaccio-bitbucket/node_modules/bcrypt/build'
  CXX(target) Release/obj.target/bcrypt_lib/src/blowfish.o
make: g++: Command not found
make: *** [Release/obj.target/bcrypt_lib/src/blowfish.o] Error 127
make: Leaving directory `/home/ec2-user/.nvm/versions/node/v13.6.0/lib/node_modules/verdaccio-bitbucket/node_modules/bcrypt/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/home/ec2-user/.nvm/versions/node/v13.6.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:321:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Linux 4.14.154-128.181.amzn2.x86_64
gyp ERR! command "/home/ec2-user/.nvm/versions/node/v13.6.0/bin/node" "/home/ec2-user/.nvm/versions/node/v13.6.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/home/ec2-u
ser/.nvm/versions/node/v13.6.0/lib/node_modules/verdaccio-bitbucket/node_modules/bcrypt/lib/binding/bcrypt_lib.node" "--module_name=bcrypt_lib" "--module_path=/home/ec2-user/.nvm/versions/node/v13.6.0/lib/node_modules/verdac
cio-bitbucket/node_modules/bcrypt/lib/binding" "--napi_version=5" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v79"
gyp ERR! cwd /home/ec2-user/.nvm/versions/node/v13.6.0/lib/node_modules/verdaccio-bitbucket/node_modules/bcrypt
gyp ERR! node -v v13.6.0
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok 
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute '/home/ec2-user/.nvm/versions/node/v13.6.0/bin/node /home/ec2-user/.nvm/versions/node/v13.6.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-bu
ild --module=/home/ec2-user/.nvm/versions/node/v13.6.0/lib/node_modules/verdaccio-bitbucket/node_modules/bcrypt/lib/binding/bcrypt_lib.node --module_name=bcrypt_lib --module_path=/home/ec2-user/.nvm/versions/node/v13.6.0/lib
/node_modules/verdaccio-bitbucket/node_modules/bcrypt/lib/binding --napi_version=5 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v79' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/home/ec2-user/.nvm/versions/node/v13.6.0/lib/node_modules/verdaccio-bitbucket/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:321:20)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:1028:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
node-pre-gyp ERR! System Linux 4.14.154-128.181.amzn2.x86_64
node-pre-gyp ERR! command "/home/ec2-user/.nvm/versions/node/v13.6.0/bin/node" "/home/ec2-user/.nvm/versions/node/v13.6.0/lib/node_modules/verdaccio-bitbucket/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /home/ec2-user/.nvm/versions/node/v13.6.0/lib/node_modules/verdaccio-bitbucket/node_modules/bcrypt
node-pre-gyp ERR! node -v v13.6.0
node-pre-gyp ERR! node-pre-gyp -v v0.13.0
node-pre-gyp ERR! not ok 
Failed to execute '/home/ec2-user/.nvm/versions/node/v13.6.0/bin/node /home/ec2-user/.nvm/versions/node/v13.6.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/home/ec2-user/.nv
m/versions/node/v13.6.0/lib/node_modules/verdaccio-bitbucket/node_modules/bcrypt/lib/binding/bcrypt_lib.node --module_name=bcrypt_lib --module_path=/home/ec2-user/.nvm/versions/node/v13.6.0/lib/node_modules/verdaccio-bitbuck
et/node_modules/bcrypt/lib/binding --napi_version=5 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v79' (1)
npm ERR! code ELIFECYCLE                                                                                                                                                                                                       
npm ERR! errno 1
npm ERR! bcrypt@3.0.7 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the bcrypt@3.0.7 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/ec2-user/.npm/_logs/2020-01-12T09_28_32_248Z-debug.log
[ec2-user@ip-9-9-0-76 verdaccio]$                                                                                                    

ОБНОВЛЕНИЕ

После @wobr ответ, я сделал следующее из AWS Руководство пользователя

[ec2-user ~]$ sudo yum groupinstall "Development Tools"

Теперь я получаю следующее:

[ec2-user@ip-9-9-0-76 verdaccio]$ npm install -g verdaccio-aws-s3-storage                                                                                                                                                       
+ verdaccio-aws-s3-storage@9.0.0                                                                                                                                                                                                
updated 1 package in 1.049s
[ec2-user@ip-9-9-0-76 verdaccio]$ npm install -g verdaccio-bitbucket                                                                                                                                                            

> bcrypt@3.0.7 install /home/ec2-user/.nvm/versions/node/v13.6.0/lib/node_modules/verdaccio-bitbucket/node_modules/bcrypt
> node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using needle for node-pre-gyp https download 
node-pre-gyp WARN Tried to download(404): https://github.com/kelektiv/node.bcrypt.js/releases/download/v3.0.7/bcrypt_lib-v3.0.7-node-v79-linux-x64-glibc.tar.gz 
node-pre-gyp WARN Pre-built binaries not found for bcrypt@3.0.7 and node@13.6.0 (node-v79 ABI, glibc) (falling back to source compile with node-gyp) 
make: Entering directory `/home/ec2-user/.nvm/versions/node/v13.6.0/lib/node_modules/verdaccio-bitbucket/node_modules/bcrypt/build'
  CXX(target) Release/obj.target/bcrypt_lib/src/blowfish.o
  CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt.o
  CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt_node.o
  SOLINK_MODULE(target) Release/obj.target/bcrypt_lib.node
  COPY Release/bcrypt_lib.node
  COPY /home/ec2-user/.nvm/versions/node/v13.6.0/lib/node_modules/verdaccio-bitbucket/node_modules/bcrypt/lib/binding/bcrypt_lib.node
  TOUCH Release/obj.target/action_after_build.stamp
make: Leaving directory `/home/ec2-user/.nvm/versions/node/v13.6.0/lib/node_modules/verdaccio-bitbucket/node_modules/bcrypt/build'
+ verdaccio-bitbucket@2.0.0
added 81 packages from 83 contributors in 5.459s
[ec2-user@ip-9-9-0-76 verdaccio]$  

1 Ответ

0 голосов
/ 18 января 2020

шаг 1: https://github.com/kelektiv/node.bcrypt.js/wiki/Installation-Instructions

шаг 2: npm i bcrypt@3.0.6

Совместимость версий (18/01/ 2019)

nodejs 12> = bcrypt@3.0.6

введите описание изображения здесь

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...