amirrea hemmati
4 سال پیش توسط amirrea hemmati مطرح شد
4 پاسخ

مشکل در نصب bcrypt برای nodejs در npm

سلام خسته نباشید.

من وقتی دستور

npm install bcrypt

رو میزنم ارور میده دلیلش رو میشه بفرمایید ....

node-pre-gyp WARN Using needle for node-pre-gyp https download

node-pre-gyp WARN Tried to download(۴۰۴): https://github.com/kelektiv/node.bcrypt.js/releases/download/v۳.۰.۷/bcrypt_lib-v۳.۰.۷-node-v۶۴-win۳۲-x۶۴-unknown.tar.gz
node-pre-gyp WARN Pre-built binaries not found for bcrypt@۳.۰.۷ and node@۱۰.۱۶.۳ (node-v۶۴ ABI, unknown) (falling back to source compile with node-gyp)
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack     at PythonFinder.failNoPython (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:۴۸۴:۱۹)
gyp ERR! stack     at PythonFinder.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:۵۰۹:۱۶)
gyp ERR! stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\polyfills.js:۲۸۲:۳۱
gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:۱۵۳:۲۱)
gyp ERR! System Windows_NT ۶.۱.۷۶۰۱
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "configure" "--fallback-to-build" "--module=D:\\developer\\practice-tutorial\\nodejs\\rest-API\\node_modules\\bcrypt\\lib\\binding\\bcrypt_lib.node" "--module_name=bcrypt_lib" "--module_path=D:\\developer\\practice-tutorial\\nodejs\\rest-API\\node_modules\\bcrypt\\lib\\binding" "--napi_version=۴" "--node_abi_napi=napi" "--napi_build_version=۰" "--node_napi_label=node-v۶۴" "--nodedir=true"
gyp ERR! cwd D:\developer\practice-tutorial\nodejs\rest-API\node_modules\bcrypt
gyp ERR! node -v v۱۰.۱۶.۳
gyp ERR! node-gyp -v v۳.۸.۰
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=D:\developer\practice-tutorial\nodejs\rest-API\node_modules\bcrypt\lib\binding\bcrypt_lib.node --module_name=bcrypt_lib --module_path=D:\developer\practice-tutorial\nodejs\rest-API\node_modules\bcrypt\lib\binding --napi_version=۴ --node_abi_napi=napi --napi_build_version=۰ --node_napi_label=node-v۶۴ --nodedir=true' (۱)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (D:\developer\practice-tutorial\nodejs\rest-API\node_modules\node-pre-gyp\lib\util\compile.js:۸۳:۲۹)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:۱۹۸:۱۳)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:۹۸۲:۱۶)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:۲۵۹:۵)
node-pre-gyp ERR! System Windows_NT ۶.۱.۷۶۰۱
node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "D:\\developer\\practice-tutorial\\nodejs\\rest-API\\node_modules\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd D:\developer\practice-tutorial\nodejs\rest-API\node_modules\bcrypt
node-pre-gyp ERR! node -v v۱۰.۱۶.۳
node-pre-gyp ERR! node-pre-gyp -v v۰.۱۳.۰
node-pre-gyp ERR! not ok
Failed to execute 'C:\Program Files\nodejs\node.exe C:\Program
Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=D:\developer\practice-tutorial\nodejs\rest-API\node_modules\bcrypt\lib\binding\bcrypt_lib.node --module_name=bcrypt_lib --module_path=D:\developer\practice-tutorial\nodejs\rest-API\node_modules\bcrypt\lib\binding --napi_version=۴ --node_abi_napi=napi --napi_build_version=۰ --node_napi_label=node-v۶۴ --nodedir=true' (۱)
npm WARN rest-api@۱.۰.۰ No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno ۱
npm ERR! bcrypt@۳.۰.۷ install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status ۱
npm ERR!
npm ERR! Failed at the bcrypt@۳.۰.۷ 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!     C:\Users\Amir\AppData\Roaming\npm-cache\_logs\۲۰۲۰-۰۱-۰۶T۱۷_۰۵_۱۰_۱۷۸Z-debug.log

اگر میشه راهنمایی کنید که چه دستوری بزنم ظاهرا دپریکیت شده باید چیکار کنم

@hesammousavi


ثبت پرسش جدید
عرفان همتی
تخصص : Backend Developer
@erfanhemmati 4 سال پیش مطرح شد
0

@Ahemmati2018
سلام. وقت بخیر
به جای استفاده از bcrypt ، میتونید از Crypto خود node استفاده کنید.
https://nodejs.org/docs/latest-v11.x/api/crypto.html


MrX
تخصص : برنامــــه نویـــــس
@sajjadMrX 3 سال پیش مطرح شد
0

@Ahemmati2018
سلام از کـد زیر واسه نصــب استفاده کنید

npm install --save bcryptjs && npm uninstall --save bcrypt

فرزاد زارع
تخصص : برنامه نویسی موبایل
@farzad.zare1992 3 سال پیش آپدیت شد
0

سلام دوست عزیز من همین الان رو پروژه node js زدم و نصب شد

npm i bcrypt --save

Ali Mortazavi
تخصص : برنامه نویس بک اند
@mortazavimaneshali 3 سال پیش مطرح شد
0

سلام میتونید با از پکیج bcryptjs استفاده کنید
خیلی تفاوتی با bcrypt نداره


برای ارسال پاسخ لازم است وارد شده یا ثبت‌نام کنید

ورود یا ثبت‌نام