首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >nodejs 6.1.0安装错误- node-pre-gyp

nodejs 6.1.0安装错误- node-pre-gyp
EN

Stack Overflow用户
提问于 2018-10-08 18:12:47
回答 1查看 603关注 0票数 0

我在谷歌上搜索了许多相关的问题,但我迷失了方向,因为我是ionic的初学者。

我的npm版本: 6.1.0

我的nodejs版本: 10.5.0

我克隆了一个私有存储库,我做的第一件事就是使用npm i来安装这些包。

然后,当它到达这里时,我遇到了错误:

代码语言:javascript
复制
> grpc@1.10.0 install D:\Projects\...\the-project\node_modules\grpc
> node-pre-gyp install --fallback-to-build --library=static_library

然后抛出了一堆错误:

代码语言:javascript
复制
node-pre-gyp ERR! Tried to download(403): https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc/v1.10.0/node-v64-win32-x64-unknown.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for grpc@1.10.0 and node@10.5.0 (node-v64 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp ERR! Tried to download(undefined): https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc/v1.10.0/node-v64-win32-x64-unknown.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for grpc@1.10.0 and node@10.5.0 (node-v64 ABI, unknown) (falling back to source compile with node-gyp)
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python2.7", you can set the PYTHON env variable.
gyp ERR! stack     at PythonFinder.failNoPython (D:\Program File\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:483:19)
gyp ERR! stack     at PythonFinder.<anonymous> (D:\Program File\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:508:16)
gyp ERR! stack     at D:\Program File\nodejs\node_modules\npm\node_modules\graceful-fs\polyfills.js:284:29
gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:158:21)
gyp ERR! gypSystem Windows_NT 10.0.16299
 ERR! configure error
gyp gypERR!  commandERR! "D:\\Program File\\nodejs\\node.exe" "D:\\Program File\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "configure" "--fallback-to-build" "--library=static_library" "--module=D:\\Projects\\...\\the-project\\node_modules\\grpc\\src\\node\\extension_binary\\node-v64-win32-x64-unknown\\grpc_node.node" "--module_name=grpc_node" "--module_path=D:\\Projects\\...\\the-project\\node_modules\\grpc\\src\\node\\extension_binary\\node-v64-win32-x64-unknown" "--python=python2.7" "--msvs_version=2013"
 stackgyp Error: Can't find Python executable "python2.7", you can set the PYTHON env variable.
 gypERR!  ERR!cwd  D:\Projects\...\the-project\node_modules\grpc
stackgyp     at PythonFinder.failNoPython (D:\Program File\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:483:19)
 gypERR!  ERR!node -v  v10.5.0
stackgyp     at PythonFinder.<anonymous> (D:\Program File\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:508:16)
 gypERR!  node-gyp -v v3.6.2
gyp ERR!ERR!  stacknot ok     at D:\Program File\nodejs\node_modules\npm\node_modules\graceful-fs\polyfills.js:284:29

gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:158:21)
gyp ERR! System Windows_NT 10.0.16299
gyp ERR! command "D:\\Program File\\nodejs\\node.exe" "D:\\Program File\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "configure" "--fallback-to-build" "--library=static_library" "--module=D:\\Projects\\...\\the-project\\node_modules\\grpc\\src\\node\\extension_binary\\node-v64-win32-x64-unknown\\grpc_node.node" "--module_name=grpc_node" "--module_path=D:\\Projects\\...\\the-project\\node_modules\\grpc\\src\\node\\extension_binary\\node-v64-win32-x64-unknown" "--python=python2.7" "--msvs_version=2013"
gyp ERR! cwd D:\Projects\...\the-project\node_modules\grpc
gyp ERR! node -v v10.5.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not oknode-pre-gyp
 ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'D:\Program File\nodejs\node.exe D:\Program File\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --library=static_library --module=D:\Projects\...\the-project\node_modules\grpc\src\node\extension_binary\node-v64-win32-x64-unknown\grpc_node.node --module_name=grpc_node --module_path=D:\Projects\...\the-project\node_modules\grpc\src\node\extension_binary\node-v64-win32-x64-unknown --python=python2.7 --msvs_version=2013' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (D:\Projects\...\the-project\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.16299
node-pre-gyp ERR! command "D:\\Program File\\nodejs\\node.exe" "D:\\Projects\\...\\the-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 D:\Projects\...\the-project\node_modules\grpc
node-pre-gyp ERR! node -v v10.5.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.39
node-pre-gyp ERR! not ok
Failed to execute 'D:\Program File\nodejs\node.exe D:\Program File\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --library=static_library --module=D:\Projects\Projects\...\the-project\node_modules\grpc\src\node\extension_binary\node-v64-win32-x64-unknown\grpc_node.node --module_name=grpc_node --module_path=D:\Projects\...\IONIC\client app\foodNinjaCustomerApp\node_modules\grpc\src\node\extension_binary\node-v64-win32-x64-unknown --python=python2.7 --msvs_version=2013' (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.0 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.0 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\....\AppData\Roaming\npm-cache\_logs\2018-10-08T10_00_32_262Z-debug.log

我已经搜索和检查了很多github/stackoverflow帖子,但我仍然迷失在中间,因为所有的解决方案都是不同的,我也不明白它是做什么的。

因此我需要你的帮助,请指教我该怎么做。

到目前为止,我所做的事情是:

1) npm install --msvs_version=2013 -g node-inspector:错误

2) npm config set msvs_version 2013:无结果

3) node-pre-gyp install --fallback-to-build:error 'node-pre-gyp' is not recognized as an internal or external command, operable program or batch file.

EN

回答 1

Stack Overflow用户

发布于 2018-10-30 23:00:11

错误说明找不到python。

gyp ERR! stack Error: Can't find Python executable "python2.7", you can set the PYTHON env variable

因此,您应该安装它(版本2.7)并将其添加到系统变量中。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/52700007

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档