简体   繁体   English

执行 npm 时出现错误 install angular-firebase --save

[英]Getting error while executing npm install angular-firebase --save

I was working on Angular Project and tried to use Firebase in it for authentication.我正在研究 Angular 项目并尝试在其中使用 Firebase 进行身份验证。 I created a new project, added some dependencies and used npm install angular-firebase --save to download and install Firebase, but I got a long error which is as follows:我创建了一个新项目,添加了一些依赖项并使用npm install angular-firebase --save来下载并安装 Firebase,但是我得到了一个很长的错误,如下所示:

    npm WARN deprecated core-js@2.5.5: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.

> grpc@1.10.1 install G:\Angular Stuff\barnd-project\node_modules\grpc
> node-pre-gyp install --fallback-to-build --library=static_library

node-pre-gyp ERR! Tried to download(403): https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc/v1.10.1/node-v72-win32-x64-unknown.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for grpc@1.10.1 and node@12.18.2 (node-v72 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp ERR! Pre-built binaries not installable for grpc@1.10.1 and node@12.18.2 (node-v72 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp ERR! Hit error Connection closed while downloading tarball file
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Platforms\x64\PlatformToolsets\v140\Toolset.targets(36,5): error MSB8036: The Windows SDK version 8.1 w
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Platforms\x64\PlatformToolsets\v140\Toolset.targets(36,5): error MSB8036: The Windows SDK version 8.1 w
as not found. Install the required version of Windows SDK or change the SDK version in the project property pages or by right-clicking the solution and select
ing "Retarget solution". [G:\Angular Stuff\barnd-project\node_modules\grpc\build\WINDOWS_BUILD_WARNING.vcxproj]
as not found. Install the required version of Windows SDK or change the SDK version in the project property pages or by right-clicking the solution and select
ing "Retarget solution". [G:\Angular Stuff\barnd-project\node_modules\grpc\build\WINDOWS_BUILD_WARNING.vcxproj]
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Platforms\x64\PlatformToolsets\v140\Toolset.targets(36,5): error MSB8036: The Windows SDK version 8.1 w
as not found. Install the required version of Windows SDK or change the SDK version in the project property pages or by right-clicking the solution and select
ing "Retarget solution". [G:\Angular Stuff\barnd-project\node_modules\grpc\build\boringssl.vcxproj]
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Platforms\x64\PlatformToolsets\v140\Toolset.targets(36,5): error MSB8036: The Windows SDK version 8.1 w
as not found. Install the required version of Windows SDK or change the SDK version in the project property pages or by right-clicking the solution and select
ing "Retarget solution". [G:\Angular Stuff\barnd-project\node_modules\grpc\build\boringssl.vcxproj]
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Platforms\x64\PlatformToolsets\v140\Toolset.targets(36,5): error MSB8036: The Windows SDK version 8.1 w
as not found. Install the required version of Windows SDK or change the SDK version in the project property pages or by right-clicking the solution and select
ing "Retarget solution". [G:\Angular Stuff\barnd-project\node_modules\grpc\build\gpr.vcxproj]
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Platforms\x64\PlatformToolsets\v140\Toolset.targets(36,5): error MSB8036: The Windows SDK version 8.1 w
as not found. Install the required version of Windows SDK or change the SDK version in the project property pages or by right-clicking the solution and select
ing "Retarget solution". [G:\Angular Stuff\barnd-project\node_modules\grpc\build\gpr.vcxproj]
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Platforms\x64\PlatformToolsets\v140\Toolset.targets(36,5): error MSB8036: The Windows SDK version 8.1 w
as not found. Install the required version of Windows SDK or change the SDK version in the project property pages or by right-clicking the solution and select
ing "Retarget solution". [G:\Angular Stuff\barnd-project\node_modules\grpc\build\grpc.vcxproj]
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Platforms\x64\PlatformToolsets\v140\Toolset.targets(36,5): error MSB8036: The Windows SDK version 8.1 w
as not found. Install the required version of Windows SDK or change the SDK version in the project property pages or by right-clicking the solution and select
ing "Retarget solution". [G:\Angular Stuff\barnd-project\node_modules\grpc\build\grpc.vcxproj]
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Platforms\x64\PlatformToolsets\v140\Toolset.targets(36,5): error MSB8036: The Windows SDK version 8.1 w
as not found. Install the required version of Windows SDK or change the SDK version in the project property pages or by right-clicking the solution and select
ing "Retarget solution". [G:\Angular Stuff\barnd-project\node_modules\grpc\build\z.vcxproj]
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Platforms\x64\PlatformToolsets\v140\Toolset.targets(36,5): error MSB8036: The Windows SDK version 8.1 w
as not found. Install the required version of Windows SDK or change the SDK version in the project property pages or by right-clicking the solution and select
ing "Retarget solution". [G:\Angular Stuff\barnd-project\node_modules\grpc\build\z.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "build" "--fallback-to-build" "--library=static_library" "--module=G:\\Angular Stuff\\barnd-project\\node_modules\\grpc\\src\\node\\extension_binary\\node-v72-win32-x64-unknown\\grpc_node.node" "--module_name=grpc_node" "--module_path=G:\\Angular Stuff\\barnd-project\\node_modules\\grpc\\src\\node\\extension_binary\\node-v72-win32-x64-unknown"
gyp ERR! cwd G:\Angular Stuff\barnd-project\node_modules\grpc
gyp ERR! node -v v12.18.2
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! node-pre-gypcommand "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "build" "--fallback-to-build" "--library=static_library" "--module=G:\\Angular Stuff\\barnd-project\\node_modules\\grpc\\src\\node\\extension_binary\\node-v72-win32-x64-unknown\\grpc_node.node" "--module_name=grpc_node" "--module_path=G:\\Angular Stuff\\barnd-project\\node_modules\\grpc\\src\\node\\extension_binary\\node-v72-win32-x64-unknown"
 gyp ERR!ERR!  build errorcwd
 G:\Angular Stuff\barnd-project\node_modules\grpc
gypnode-pre-gyp  ERR!ERR!  node -vstack v12.18.2
 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 build --fallback-to-build --library=static_library --module=G:\Angular Stuff\barnd-project\node_modules\grpc\src\node\extension_binary\node-v72-win32-x64-unknown\grpc_node.node --module_name=grpc_node --module_path=G:\Angular Stuff\barnd-project\node_modules\grpc\src\node\extension_binary\node-v72-win32-x64-unknown' (1)
gyp node-pre-gypERR!  ERR!node-gyp -v  v5.1.0
stackgyp     at ChildProcess.<anonymous> (G:\Angular Stuff\barnd-project\node_modules\grpc\node_modules\node-pre-gyp\lib\util\compile.js:83:29)
 node-pre-gypERR!  ERR!not ok
stack     at ChildProcess.emit (events.js:315:20)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:1021:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
node-pre-gyp ERR! System Windows_NT 10.0.17134
node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "G:\\Angular Stuff\\barnd-project\\node_modules\\grpc\\node_modules\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build" "--library=static_library"
node-pre-gyp ERR! cwd G:\Angular Stuff\barnd-project\node_modules\grpc
node-pre-gyp ERR! node -v v12.18.2
node-pre-gyp ERR! node-pre-gyp -v v0.7.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 build --fallback-to-build --library=static_library --module=G:\Angular Stuff\barnd-project\node_modules\grpc\src\node\extension_binary\node-v72-win32-x64-unknown\grpc_node.node --module_name=grpc_node --module_path=G:\Angular Stuff\barnd-project\node_modules\grpc\src\node\extension_binary\node-v72-win32-x64-unknown' (1)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! grpc@1.10.1 install: `node-pre-gyp install --fallback-to-build --library=static_library`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the grpc@1.10.1 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\user\AppData\Roaming\npm-cache\_logs\2020-07-07T12_11_51_980Z-debug.log

I have installed Windows SDK and node-gyp but still no luck.我已经安装了Windows SDKnode-gyp gyp 但仍然没有运气。 Both NodeJS and Angular CLI is updated to there latest versions still, it's giving the error. NodeJS 和 Angular CLI 仍然更新到最新版本,它给出了错误。

It seems that your firebase install fails due to grpc.. This can correspond to many differents problems..您的 firebase 安装似乎由于 grpc 而失败。这可能对应于许多不同的问题。

A few:一些:

  • Disable your antivirus, few users said that Kapersky can stuck npm install.. See issue on github禁用你的杀毒软件,很少有用户说卡巴斯基会卡住 npm 安装..请参阅 github 上的问题
  • You can try npm install --build-from-source @grpc/grpc-js你可以试试npm install --build-from-source @grpc/grpc-js
  • Or maybe it's this case或者也许就是这种情况

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

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