无法使用npm安装firebase-tools

时间:2017-08-09 16:06:29

标签: javascript node.js npm

我正在尝试为我的android工作室项目安装firebase-tools但它导致我出现以下错误

Microsoft Windows [版本10.0.15063] (c)2017 Microsoft Corporation。保留所有权利。

C:\ WINDOWS \ system32> npm install -g firebase-tools npm WARN弃用node-uuid@1.4.8:改用uuid模块 C:\ Users \ jay \ AppData \ Roaming \ npm \ firebase - > C:\ Users \用户周杰伦\应用程序数据\漫游\ NPM \ node_modules \火力工具\ BIN \火力

  

node-zopfli@1.4.0安装C:\ Users \ jay \ AppData \ Roaming \ npm \ node_modules \ firebase-tools \ node_modules \ node-zopfli   node-pre-gyp install --fallback-to-build

node-pre-gyp ERR! Tried to download(403): https://node-zopfli.s3.amazonaws.com/Release/zopfli-v1.4.0-node-v48-win32-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for node-zopfli@1.4.0 and node@6.11.2 (node-v48 ABI) (falling back to source compile with node-gyp)

C:\Users\jay\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\node-zopfli>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" clean )  else (node "" clean )

C:\Users\jay\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\node-zopfli>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" configure --fallback-to-build --module=C:\Users\jay\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\node-zopfli\lib\binding\node-v48-win32-x64\zopfli.node --module_name=zopfli --module_path=C:\Users\jay\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\node-zopfli\lib\binding\node-v48-win32-x64 )  else (node "" configure --fallback-to-build --module=C:\Users\jay\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\node-zopfli\lib\binding\node-v48-win32-x64\zopfli.node --module_name=zopfli --module_path=C:\Users\jay\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\node-zopfli\lib\binding\node-v48-win32-x64 )

C:\Users\jay\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\node-zopfli>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" build --fallback-to-build --module=C:\Users\jay\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\node-zopfli\lib\binding\node-v48-win32-x64\zopfli.node --module_name=zopfli --module_path=C:\Users\jay\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\node-zopfli\lib\binding\node-v48-win32-x64 )  else (node "" build --fallback-to-build --module=C:\Users\jay\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\node-zopfli\lib\binding\node-v48-win32-x64\zopfli.node --module_name=zopfli --module_path=C:\Users\jay\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\node-zopfli\lib\binding\node-v48-win32-x64 )
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 was not found. Install the required version of Windows SDK or change the SDK vers
ion in the project property pages or by right-clicking the solution and selecting "Retarget solution". [C:\Users\jay\Ap
pData\Roaming\npm\node_modules\firebase-tools\node_modules\node-zopfli\build\zopfli.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:276:23)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Windows_NT 10.0.15063
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" "--module=C:\\Users\\jay\\AppData\\Roaming\\npm\\node_modules\\firebase-tools\\node_modules\\node-zopfli\\lib\\binding\\node-v48-win32-x64\\zopfli.node" "--module_name=zopfli" "--module_path=C:\\Users\\jay\\AppData\\Roaming\\npm\\node_modules\\firebase-tools\\node_modules\\node-zopfli\\lib\\binding\\node-v48-win32-x64"
gyp ERR! cwd C:\Users\jay\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\node-zopfli
gyp ERR! node -v v6.11.2
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'node-gyp.cmd build --fallback-to-build --module=C:\Users\jay\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\node-zopfli\lib\binding\node-v48-win32-x64\zopfli.node --module_name=zopfli --module_path=C:\Users\jay\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\node-zopfli\lib\binding\node-v48-win32-x64' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (C:\Users\jay\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\node-pre-gyp\lib\util\compile.js:83:29)
node-pre-gyp ERR! stack     at emitTwo (events.js:106:13)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:891:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
node-pre-gyp ERR! System Windows_NT 10.0.15063
node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\jay\\AppData\\Roaming\\npm\\node_modules\\firebase-tools\\node_modules\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd C:\Users\jay\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\node-zopfli
node-pre-gyp ERR! node -v v6.11.2
node-pre-gyp ERR! node-pre-gyp -v v0.6.36
node-pre-gyp ERR! not ok
Failed to execute 'node-gyp.cmd build --fallback-to-build --module=C:\Users\jay\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\node-zopfli\lib\binding\node-v48-win32-x64\zopfli.node --module_name=zopfli --module_path=C:\Users\jay\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\node-zopfli\lib\binding\node-v48-win32-x64' (1)
C:\Users\jay\AppData\Roaming\npm
`-- firebase-tools@3.9.2

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: node-zopfli@1.4.0 (node_modules\firebase-tools\node_modules\node-zopfli):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: node-zopfli@1.4.0 install: `node-pre-gyp install --fallback-to-build`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

C:\WINDOWS\system32>

1 个答案:

答案 0 :(得分:0)

在您的警告消息中,node-uuid已弃用,因此请将其卸载并改为使用uuid

  

npm WARN不推荐使用node-uuid@1.4.8:改为使用uuid模块

试试这种方式,

npm uninstall --save node-uuid
npm install --save uuid