简体   繁体   English

我将 bcrypt 安装到我的 package.json 中没有什么问题

[英]I have little problem installing bcrypt to my package.json


I have started my project and I have started installing packages but suddenly I got an error and that error comes when I try to install a bcrypt.我已经开始了我的项目,我已经开始安装软件包,但突然我收到一个错误,当我尝试安装 bcrypt 时出现错误。


  1. first I try to install bcrypt.首先我尝试安装 bcrypt。

     npm install bcrypt
  2. I got an error.我有一个错误。

     > bcrypt@3.0.7 install C:\\Users\\Abdulsalam\\application\\clothes_store\\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-v64-win32-x64-unknown.tar.gz node-pre-gyp WARN Pre-built binaries not found for bcrypt@3.0.7 and node@10.15.3 (node-v64 ABI, unknown) (falling back to source compile with node-gyp) gyp ERR! configure error gyp ERR! stack Error: Command failed: C:\\Users\\Abdulsalam\\AppData\\Local\\Programs\\Python\\Python36\\python.EXE -c import sys; print "%s.%s.%s" % sys.version_info[:3]; gyp ERR! stack File "<string>", line 1 gyp ERR! stack import sys; print "%s.%s.%s" % sys.version_info[:3]; gyp ERR! stack ^ gyp ERR! stack SyntaxError: invalid syntax gyp ERR! stack gyp ERR! stack at ChildProcess.exithandler (child_process.js:294:12) gyp ERR! stack at ChildProcess.emit (events.js:189:13) gyp ERR! stack at maybeClose (internal/child_process.js:970:16) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5) gyp ERR! System Windows_NT 10.0.18362 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=C:\\\\Users\\\\Abdulsalam\\\\application\\\\clothes_store\\\\node_modules\\\\bcrypt\\\\lib\\\\binding\\\\bcrypt_lib.node" "--module_name=bcrypt_lib" "--module_path=C:\\\\Users\\\\Abdulsalam\\\\application\\\\clothes_store\\\\node_modules\\\\bcrypt\\\\lib\\\\binding" "--napi_version=3" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v64" gyp ERR! cwd C:\\Users\\Abdulsalam\\application\\clothes_store\\node_modules\\bcrypt gyp ERR! node -v v10.15.3 gyp ERR! node-gyp -v v3.8.0 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=C:\\Users\\Abdulsalam\\application\\clothes_store\\node_modules\\bcrypt\\lib\\binding\\bcrypt_lib.node --module_name=bcrypt_lib --module_path=C:\\Users\\Abdulsalam\\application\\clothes_store\\node_modules\\bcrypt\\lib\\binding --napi_version=3 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v64' (1) node-pre-gyp ERR! stack at ChildProcess.<anonymous> (C:\\Users\\Abdulsalam\\application\\clothes_store\\node_modules\\node-pre-gyp\\lib\\util\\compile.js:83:29) node-pre-gyp ERR! stack at ChildProcess.emit (events.js:189:13) node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:970:16) node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5) node-pre-gyp ERR! System Windows_NT 10.0.18362 node-pre-gyp ERR! command "C:\\\\Program Files\\\\nodejs\\\\node.exe" "C:\\\\Users\\\\Abdulsalam\\\\application\\\\clothes_store\\\\node_modules\\\\node-pre-gyp\\\\bin\\\\node-pre-gyp" "install" "--fallback-to-build" node-pre-gyp ERR! cwd C:\\Users\\Abdulsalam\\application\\clothes_store\\node_modules\\bcrypt node-pre-gyp ERR! node -v v10.15.3 node-pre-gyp ERR! node-pre-gyp -v v0.13.0 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=C:\\Users\\Abdulsalam\\application\\clothes_store\\node_modules\\bcrypt\\lib\\binding\\bcrypt_lib.node --module_name=bcrypt_lib --module_path=C:\\Users\\Abdulsalam\\application\\clothes_store\\node_modules \\bcrypt\\lib\\binding --napi_version=3 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v64' (1) npm WARN clothes_store@1.0.0 No description npm WARN clothes_store@1.0.0 No repository field. npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.2 (node_modules\\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}) 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! C:\\Users\\Abdulsalam\\AppData\\Roaming\\npm-cache\\_logs\\2019-12-09T18_07_53_927Z-debug.log

Sorry It's a long error but I hope someone helps me because I have to finish this project very quickly and I haven't started yet.抱歉,这是一个很长的错误,但我希望有人能帮助我,因为我必须非常快地完成这个项目,而我还没有开始。

如果您使用的是 Windows,则需要通过以下方式使用 bcryptjs:

npm install --save bcryptjs

You are facing some of the error described inside the bcrypt package.您正面临bcrypt包中描述的一些错误。 I advice you to go to their npm page and read through the description.我建议你去他们的 npm 页面阅读描述。

They have a paragraph where they describe:他们有一段描述:

IF you have an error like this:如果你有这样的错误:

node-pre-gyp ERR! Tried to download(404): https://github.com/kelektiv/node.bcrypt.js/releases/download/v1.0.2/bcrypt_lib-v1.0.2-node-v48-linux-x64.tar.gz

make sure you have the appropriate dependencies installed and configured for your platform.确保为您的平台安装和配置了适当的依赖项。 You can find installation instructions for the dependencies for some common platforms in this page .您可以在此页面中找到一些常见平台的依赖项的安装说明。

So I just advice you to go to their page and follow the instructions..所以我只是建议你去他们的页面并按照说明进行操作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM