0

Hi I have cloned a nestJs project from git. To run that project , try to install the node modules using the

npm i

It prompts the error as below :

kathishkumaran@kathish-Latitude-3420:~/Documents/projects$ npm i
npm ERR! code 1
npm ERR! path /home/kathishkumaran/Documents/project/node_modules/bcrypt
npm ERR! command failed
npm ERR! command sh -c node-pre-gyp install --fallback-to-build
npm ERR! Failed to execute '/usr/bin/node /home/kathishkumaran/.nvm/versions/node/v18.14.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/home/kathishkumaran/Documents/project/node_modules/bcrypt/lib/binding/napi-v3/bcrypt_lib.node --module_name=bcrypt_lib --module_path=/home/kathishkumaran/Documents/project/node_modules/bcrypt/lib/binding/napi-v3 --napi_version=5 --node_abi_napi=napi --napi_build_version=3' (7)
npm ERR! node-pre-gyp info it worked if it ends with ok
npm ERR! node-pre-gyp info using node-pre-gyp@0.10.2
npm ERR! node-pre-gyp info using node@10.19.0 | linux | x64
npm ERR! node-pre-gyp info build requesting source compile
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@9.3.0
npm ERR! gyp info using node@10.19.0 | linux | x64
npm ERR! gyp info ok 
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@9.3.0
npm ERR! gyp info using node@10.19.0 | linux | x64
npm ERR! gyp info find Python using Python version 3.8.10 found at "/usr/bin/python3"
npm ERR! gyp ERR! UNCAUGHT EXCEPTION 
npm ERR! gyp ERR! stack TypeError: Object.fromEntries is not a function
npm ERR! gyp ERR! stack     at Object.<anonymous> (/home/kathishkumaran/.nvm/versions/node/v18.14.0/lib/node_modules/npm/node_modules/node-gyp/node_modules/@npmcli/fs/lib/fs.js:6:23)
npm ERR! gyp ERR! stack     at Module._compile (internal/modules/cjs/loader.js:778:30)
npm ERR! gyp ERR! stack     at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
npm ERR! gyp ERR! stack     at Module.load (internal/modules/cjs/loader.js:653:32)
npm ERR! gyp ERR! stack     at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
npm ERR! gyp ERR! stack     at Function.Module._load (internal/modules/cjs/loader.js:585:3)
npm ERR! gyp ERR! stack     at Module.require (internal/modules/cjs/loader.js:692:17)
npm ERR! gyp ERR! stack     at require (internal/modules/cjs/helpers.js:25:18)
npm ERR! gyp ERR! stack     at Object.<anonymous> (/home/kathishkumaran/.nvm/versions/node/v18.14.0/lib/node_modules/npm/node_modules/node-gyp/node_modules/@npmcli/fs/lib/index.js:2:6)
npm ERR! gyp ERR! stack     at Module._compile (internal/modules/cjs/loader.js:778:30)
npm ERR! gyp ERR! System Linux 5.14.0-1056-oem
npm ERR! gyp ERR! command "/usr/bin/node" "/home/kathishkumaran/.nvm/versions/node/v18.14.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/home/kathishkumaran/Documents/project/node_modules/bcrypt/lib/binding/napi-v3/bcrypt_lib.node" "--module_name=bcrypt_lib" "--module_path=/home/kathishkumaran/Documents/projects/node_modules/bcrypt/lib/binding/napi-v3" "--napi_version=5" "--node_abi_napi=napi" "--napi_build_version=3"
npm ERR! gyp ERR! cwd /home/kathishkumaran/Documents/project/node_modules/bcrypt
npm ERR! gyp ERR! node -v v10.19.0
npm ERR! gyp ERR! node-gyp -v v9.3.0
npm ERR! gyp ERR! Node-gyp failed to build your package.
npm ERR! gyp ERR! Try to update npm and/or node-gyp and if it does not help file an issue with the package author.
npm ERR! node-pre-gyp ERR! build error 
npm ERR! node-pre-gyp ERR! stack Error: Failed to execute '/usr/bin/node /home/kathishkumaran/.nvm/versions/node/v18.14.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/home/kathishkumaran/Documents/project/node_modules/bcrypt/lib/binding/napi-v3/bcrypt_lib.node --module_name=bcrypt_lib --module_path=/home/kathishkumaran/Documents/projects/node_modules/bcrypt/lib/binding/napi-v3 --napi_version=5 --node_abi_napi=napi --napi_build_version=3' (7)
npm ERR! node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/usr/lib/nodejs/node-pre-gyp/lib/util/compile.js:83:29)
npm ERR! node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:198:13)
npm ERR! node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:982:16)
npm ERR! node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
npm ERR! node-pre-gyp ERR! System Linux 5.14.0-1056-oem
npm ERR! node-pre-gyp ERR! command "/usr/bin/node" "/usr/bin/node-pre-gyp" "install" "--fallback-to-build"
npm ERR! node-pre-gyp ERR! cwd /home/kathishkumaran/Documents/projects/node_modules/bcrypt
npm ERR! node-pre-gyp ERR! node -v v10.19.0
npm ERR! node-pre-gyp ERR! node-pre-gyp -v v0.10.2
npm ERR! node-pre-gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/kathishkumaran/.npm/_logs/2023-02-15T17_35_42_847Z-debug-0.log

I have tried uninstalling the bcrypt package with the npm uninstall bcrypt command and tried npm i but it showed the same error.

Please help me fixing this issue with bcrypt package in nestJs application in ubuntu system.

0 Answers0