安装从GitHub派生的Angular Material Library时出错

时间:2018-08-14 05:47:53

标签: angular npm angular-material

尝试安装https://github.com/angular/material2分叉的库
通过运行命令:

git clone git@github.com:vugar005/material2.git

获取错误:  npm WARN read-shrinkwrap此版本的npm与lockfileVersion @ 1兼容,但npm-shrinkwrap.json是为lockfileVersion @ 0生成的。我会尽力做到这一点!

> grpc@1.10.1 install E:\vugar\material2\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-v64-win32-x64-unknown.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for grpc@1.10.1 and node@10.3.0 (node-v64 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@10.3.0 (node-v64 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp ERR! Hit error Connection closed while downloading tarball file
gyp ERR!gyp configure error
 ERR! gyp configure errorERR!
 stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gypgyp  ERR!ERR!  stackstack Error: Can't find Python executable "python", you can set the PYTHON env variable.
     at PythonFinder.failNoPython (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:483:19)
gypgyp  ERR!ERR! stack      at PythonFinder.failNoPython (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:483:19)
stackgyp     at PythonFinder.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:508:16)
 gypERR!  stackERR!     at PythonFinder.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:508:16)
 gypstack      at C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\polyfills.js:284:29
ERR!gyp  stackERR!     at C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\polyfills.js:284:29
 gypstack      at FSReqWrap.oncomplete (fs.js:182:21)
ERR! stackgyp     at FSReqWrap.oncomplete (fs.js:182:21)
 ERR!gyp  SystemERR! Windows_NT 10.0.17134
 Systemgyp Windows_NT 10.0.17134
 ERR!gyp  commandERR! "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" "--library=static_library" "--module=E:\\vugar\\material2\\node_modules\\grpc\\sr
c\\node\\extension_binary\\node-v64-win32-x64-unknown\\grpc_node.node" "--module_name=grpc_node" "--module_path=E:\\vugar\\material2\\node_modules\\grpc\\src\\node\\extension_binary\\node-v64-win32-x64-unknown"
 gypcommand  "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" "--library=static_library" "--module=E:\\vugar\\material2\\node_modules\\grpc\\src\\node\\
extension_binary\\node-v64-win32-x64-unknown\\grpc_node.node" "--module_name=grpc_node" "--module_path=E:\\vugar\\material2\\node_modules\\grpc\\src\\node\\extension_binary\\node-v64-win32-x64-unknown"
ERR!gyp  cwdERR! E:\vugar\material2\node_modules\grpc
 gypcwd E:\vugar\material2\node_modules\grpc
 gypERR!  ERR!node -v  v10.3.0
node -vgyp v10.3.0
 gypERR!  ERR!node-gyp -v  v3.6.2
node-gyp -vgyp v3.6.2
 gypERR!  not ok
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 --library=static_library --module=E:\vugar\material2\node_modules\grpc\s
rc\node\extension_binary\node-v64-win32-x64-unknown\grpc_node.node --module_name=grpc_node --module_path=E:\vugar\material2\node_modules\grpc\src\node\extension_binary\node-v64-win32-x64-unknown' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (E:\vugar\material2\node_modules\grpc\node_modules\node-pre-gyp\lib\util\compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:961:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:248:5)
node-pre-gyp ERR! System Windows_NT 10.0.17134
node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "E:\\vugar\\material2\\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:\vugar\material2\node_modules\grpc
node-pre-gyp ERR! node -v v10.3.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:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --library=static_library --module=E:\vugar\material2\node_modules\grpc\src\node\extension_binary\node-v
64-win32-x64-unknown\grpc_node.node --module_name=grpc_node --module_path=E:\vugar\material2\node_modules\grpc\src\node\extension_binary\node-v64-win32-x64-unknown' (1)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: 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.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Unibook\AppData\Roaming\npm-cache\_logs\2018-08-14T05_44_56_525Z-debug.log

还安装了Pyton 3.7并添加到了补丁中,但没有解决问题。
操作系统:Win10 64位
节点:v10.3.0
npm:v6.10
angular-cli:6.0.3

1 个答案:

答案 0 :(得分:0)

问题是由于节点版本引起的。切换到节点v8 LTS并解决了问题。