首页 文章

在nodejs中安装bycrpt时出错?每当我运行npm install install --save?

提问于
浏览
0

bcrypt@3.0.0安装C:\ projects \ alecadApi \ node_modules \ bcrypt node-pre-gyp install --fallback-to-build

node-pre-gyp WARN试图下载(404):https://github.com/kelektiv/node.bcrypt.js/releases/download/v3.0.0/bcrypt_lib-v3.0.0-node-v57-win32-x64-unknown.tar.gz node-pre-gyp WARN未找到bcrypt@3.0.0和node@8.10.0的预构建二进制文件(node-v57 ABI,未知)(使用node-gyp回退到源代码编译)这个解决方案中的项目一次一个 . 要启用并行构建,请添加"/m"开关 . C:\projects\alecadApi\node_modules\bcrypt\build\bcrypt_lib.vcxproj(20,3) :错误MSB4019:找不到导入的项目"C:\Microsoft.Cp p.Default.props" . 确认声明中的路径是否正确,以及该文件是否存在于磁盘上 . gyp ERR! 构建错误 gyp ERR! 堆栈错误: C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe 失败,退出代码:1 gyp ERR!堆栈在ChildProcess.onExit(C:\ Users \ adity \ AppData \ Roaming \ npm \ node_modules \ npm \ node_modules \ node-gyp \ lib \ build.js:258:23)gyp ERR!堆栈在emitTwo(events.js:126:13)gyp ERR!在ChildProcess.emit堆栈(events.js:214:7)gyp ERR! Process.ChildProcess._handle.onexit(内部/ child_process.js:198:12)的堆栈 gyp ERR! 系统Windows_NT 10.0.17134 gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\adity\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "build" "--fallback-to-build" "--module=C:\projects\alecadApi\node_modules\bcrypt\lib\binding\bcrypt_lib.node" "--module_name=bcrypt_lib" "--module_path=C:\projects\alecadApi\node_modules\bcrypt\lib\binding" "--napi_version=1" "--node_abi_napi=napi" gyp ERR! cwd C:\ projects \ alecadApi \ node_modules \ bcrypt gyp ERR ! node -v v8.10.0 gyp ERR! node-gyp -v v3.6.2 gyp ERR! not ok node-pre-gyp ERR!构建错误 node-pre-gyp 错误!堆栈错误:无法执行'C:\Program Files\nodejs\node.exe C:\Users\adity\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js build --fallback-to-build --module=C:\projects\alecadApi\node_modules\bcrypt\lib\binding\bcrypt_lib.node --module_name=bcrypt_lib --module_path=C:\projects\alecadApi\node_modules\bcrypt\lib\binding --napi_version=1 --node_abi_napi=napi'(1)node-pre-gyp ERR!在ChildProcess堆栈 . (C:\ Projects \ alecadApi \ node_modules \ bcrypt \ node_modules \ node-pre-gyp \ lib \ util \ compile.js:83:29) node-pre-gyp 错误!堆栈在emitTwo(events.js:126:13) node-pre-gyp 错误!堆栈在ChildProcess.emit(events.js:214:7) node-pre-gyp 错误!堆栈在maybeClose(内部/ child_process.js:925:16) node-pre-gyp 错误! Process.ChildProcess._handle.onexit(internal / child_process.js:209:5)的堆栈 node-pre-gyp 错误!系统Windows_NT 10.0.17134 node-pre-gyp 错误!命令"C:\Program Files\nodejs\node.exe" "C:\Projects\alecadApi\node_modules\bcrypt\node_modules\node-pre-gyp\bin\node-pre-gyp" "install" "--fallback-to-build" node-pre-gyp 错误! cwd C:\ projects \ alecadApi \ node_modules \ bcrypt node-pre-gyp 错误! node -v v8.10.0 node-pre-gyp 错误! node-pre-gyp -v v0.10.2 node-pre-gyp 错误! not ok无法执行'C:\Program Files\nodejs\node.exe C:\Users\adity\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js build --fallback-to-build --module=C:\projects\alecadApi\node_modules\bcrypt\lib\binding\bcrypt_lib.node --module_name=bcrypt_lib --module_path=C:\projects\alecadApi\node_modules\bcrypt\lib\binding --napi_version=1 --node_abi_napi=napi'(1) npm WARN alecadApi@1.0.0没有存储库字段 . npm WARN 可选SKIPPING OPTIONAL DEPENDENCY:fsevents@1.2.4(node_modules \ fsevents): npm WARN notsup跳过选择依赖:fsevents@1.2.4不支持的平台:想要{"os":"darwin","arch":"any"}(当前:{"os":"win32", "arch":"x64"})

npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! bcrypt@3.0.0 install: node-pre-gyp install --fallback-to-build npm ERR! 退出状态1 npm ERR! npm ERR! bcrypt@3.0.0安装脚本失败 . npm ERR! 这可能不是npm的问题 . 上面可能有额外的日志记录输出 .

npm ERR! 此运行的完整日志位于: npm ERR! C:\ Users \ adity \ AppData \ Roaming \ npm-cache_logs \ 2018-07-07T10_51_34_631Z-debug.log

3 回答

  • 0

    你试过this吗?

    使用管理员权限打开powershell并运行此命令,然后继续安装bcrypt . npm install --global --production windows-build-tools

    注意:等到在PowerShell窗口中看到“ All Done! ”,然后继续安装模块 .

  • 0

    您需要单独安装bcrypt .

    执行 npm install bcrypt --save 并在此操作完成后再次运行 npm install .

    您还可以查看this链接以获得类似问题的答案 .

    或者,如果这不起作用,您可以使用 bcrypt-nodejsbcryptjs 包 .

  • 1

    你应该用

    npm install --save bcrypt
    

    为了正确安装 .

    顺便使用bcrypt你需要安装python . 如果你想与python无关,请使用bcryptjs

    npm install --save bcryptjs
    

相关问题