代码之家  ›  专栏  ›  技术社区  ›  salman94

在Angular Project中安装FireBase时获取安装错误

  •  0
  • salman94  · 技术社区  · 6 年前

    在Angular项目中,我必须使用FireBase SDK,因为我必须在项目中安装FireBase。我尝试使用命令“npm install angular firebase--save”将它安装到我的Angular项目中。它引发此错误:

    > grpc@1.10.1 install E:\MyAngularApp\my-angular-app\node_modules\grpc
    > node-pre-gyp install --fallback-to-build --library=static_library
    
    node-pre-gyp ERR! Pre-built binaries not installable for grpc@1.10.1 and node@8.12.0 (node-v57 ABI, unknown) (falling back to source compile with node-gyp)
    node-pre-gyp ERR! Hit error read ECONNRESET
    gyp WARN install got an error, rolling back install
    gyp ERR! configure error
    gyp ERR! stack Error: read ECONNRESET
    gyp ERR! stack     at TLSWrap.onread (net.js:622:25)
    gyp ERR! System Windows_NT 10.0.17134
    gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\mo388682\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "configure" "--fallback-to-build" "--library=static_library" "--module=E:\\MyAngularApp\\my-angular-app\\node_modules\\grpc\\src\\node\\extension_binary\\node-v57-win32-x64-unknown\\grpc_node.node" "--module_name=grpc_node" "--module_path=E:\\MyAngularApp\\my-angular-app\\node_modules\\grpc\\src\\node\\extension_binary\\node-v57-win32-x64-unknown"
    gyp ERR! cwd E:\MyAngularApp\my-angular-app\node_modules\grpc
    gyp ERR! node -v v8.12.0
    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:\Users\mo388682\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --library=static_library --module=E:\MyAngularApp\my-angular-app\node_modules\grpc\src\node\extension_binary\node-v57-win32-x64-unknown\grpc_node.node --module_name=grpc_node --module_path=E:\MyAngularApp\my-angular-app\node_modules\grpc\src\node\extension_binary\node-v57-win32-x64-unknown' (1)
    node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (E:\MyAngularApp\my-angular-app\node_modules\grpc\node_modules\node-pre-gyp\lib\util\compile.js:83:29)
    node-pre-gyp ERR! stack     at emitTwo (events.js:126:13)
    node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
    node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:915:16)
    node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
    node-pre-gyp ERR! System Windows_NT 10.0.17134
    node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "E:\\MyAngularApp\\my-angular-app\\node_modules\\grpc\\node_modules\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build" "--library=static_library"
    node-pre-gyp ERR! cwd E:\MyAngularApp\my-angular-app\node_modules\grpc
    node-pre-gyp ERR! node -v v8.12.0
    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:\Users\mo388682\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --library=static_library --module=E:\MyAngularApp\my-angular-app\node_modules\grpc\src\node\extension_binary\node-v57-win32-x64-unknown\grpc_node.node --module_name=grpc_node --module_path=E:\MyAngularApp\my-angular-app\node_modules\grpc\src\node\extension_binary\node-v57-win32-x64-unknown' (1)
    npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.7 (node_modules\fsevents):
    npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
    
    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.
    

    如何解决此问题?

    1 回复  |  直到 6 年前
        1
  •  0
  •   Ricardo Smania    6 年前

    如果尚未安装,请尝试安装Windows生成工具: https://www.npmjs.com/package/windows-build-tools

    npm install --global windows-build-tools
    

    yarn global add windows-build-tools