npm i 期间出错:节点预 gyp 安装 --回退到构建 --library=static_library



我知道我不应该只是抛出这样的问题并希望我能提供更多信息,但我真的不知道它是什么,这也是我第一次遇到这样的问题(更换到新笔记本电脑后(,我想目前我只能提供错误消息,直到有人要求我提供更多信息。

下面是运行 npm i 时我的 cmder 中显示的错误

D:ADAProjectsfoodNinjaCustomerApp (Jerry-Dev2 -> origin)                    
λ npm i                                                                        
> grpc@1.10.0 install D:ADAProjectsfoodNinjaCustomerAppnode_modulesgrpc   
> node-pre-gyp install --fallback-to-build --library=static_library            
node-pre-gyp ERR! Tried to download(403): https://storage.googleapis.com/grpc-p
recompiled-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)         
gypgyp  ERR! ERR!configure error                                               
configure error                                                                
gypgyp  ERR!ERR!  stackstack Error: Can't find Python executable "python", you 
can set the PYTHON env variable.                                               
Error: Can't find Python executable "python", you can set the PYTHON env varia
ble.                                                                           
gypgyp  ERR!ERR!  stackstack     at PythonFinder.failNoPython (D:Program File
nodejsnode_modulesnpmnode_modulesnode-gyplibconfigure.js:483:19)         
at PythonFinder.failNoPython (D:Program Filenodejsnode_modulesnpmnode
_modulesnode-gyplibconfigure.js:483:19)                                     
gypgyp  ERR!ERR!  stackstack     at PythonFinder.<anonymous> (D:Program Filen
odejsnode_modulesnpmnode_modulesnode-gyplibconfigure.js:508:16)          
at PythonFinder.<anonymous> (D:Program Filenodejsnode_modulesnpmnode_
modulesnode-gyplibconfigure.js:508:16)                                      
gypgyp  ERR!ERR!  stackstack     at D:Program Filenodejsnode_modulesnpmnod
e_modulesgraceful-fspolyfills.js:284:29                                      
at D:Program Filenodejsnode_modulesnpmnode_modulesgraceful-fspolyfi
lls.js:284:29                                                                  
gypgyp  ERR!ERR!  stackstack     at FSReqWrap.oncomplete (fs.js:158:21)        
at FSReqWrap.oncomplete (fs.js:158:21)                                    
gypgyp  ERR!ERR!  SystemSystem Windows_NT 10.0.16299                           
Windows_NT 10.0.16299                                                         
gypgyp  ERR!ERR!  commandcommand "D:\Program File\nodejs\node.exe" "D:\Prog
ram File\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" 
"configure" "--fallback-to-build" "--library=static_library" "--module=D:\ADA
Projects\foodNinjaCustomerApp\node_modules\grpc\src\node\extension_binar
y\node-v64-win32-x64-unknown\grpc_node.node" "--module_name=grpc_node" "--mod
ule_path=D:\ADA\Projects\foodNinjaCustomerApp\node_modules\grpc\src\node
\extension_binary\node-v64-win32-x64-unknown"                                
"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:\ADA\Projects\foodNinjaCustomerApp
node_modules\grpc\src\node\extension_binary\node-v64-win32-x64-unknown\g
rpc_node.node" "--module_name=grpc_node" "--module_path=D:\ADA\Projects\food
NinjaCustomerApp\node_modules\grpc\src\node\extension_binary\node-v64-win
32-x64-unknown"                                                                
gypgyp  ERR!ERR!  cwdcwd D:ADAProjectsfoodNinjaCustomerAppnode_modulesgrpc
D:ADAProjectsfoodNinjaCustomerAppnode_modulesgrpc                        
gypgyp  ERR!ERR!  node -vnode -v v10.5.0                                       
v10.5.0                                                                       
gypgyp  ERR!ERR!  node-gyp -v v3.6.2                                           
node-gyp -v v3.6.2                                                             
gyp gyp ERR! ERR!not ok                                                        
not ok                                                                         
node-pre-gyp ERR! build error                                                  
node-pre-gyp ERR! stack Error: Failed to execute 'D:Program Filenodejsnode.e
xe D:Program Filenodejsnode_modulesnpmnode_modulesnode-gypbinnode-gyp.j
s configure --fallback-to-build --library=static_library --module=D:ADAProjec
tsfoodNinjaCustomerAppnode_modulesgrpcsrcnodeextension_binarynode-v64-wi
n32-x64-unknowngrpc_node.node --module_name=grpc_node --module_path=D:ADAPro
jectsfoodNinjaCustomerAppnode_modulesgrpcsrcnodeextension_binarynode-v64
-win32-x64-unknown' (1)                                                        
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (D:ADAProjectsfoodNi
njaCustomerAppnode_modulesgrpcnode_modulesnode-pre-gyplibutilcompile.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/ch
ild_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:\ADA\Projec
ts\foodNinjaCustomerApp\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:ADAProjectsfoodNinjaCustomerAppnode_modulesgrpc   
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 Filenodejsnode.exe D:Program Filenodejsnode_
modulesnpmnode_modulesnode-gypbinnode-gyp.js configure --fallback-to-build
--library=static_library --module=D:ADAProjectsfoodNinjaCustomerAppnode_mo
dulesgrpcsrcnodeextension_binarynode-v64-win32-x64-unknowngrpc_node.node 
--module_name=grpc_node --module_path=D:ADAProjectsfoodNinjaCustomerAppnode
_modulesgrpcsrcnodeextension_binarynode-v64-win32-x64-unknown' (1)        
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modulesfs
events):                                                                       
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 --libra
ry=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 lo
gging output above.                                                            
npm ERR! A complete log of this run can be found in:                           
npm ERR!     C:Usersjerry.hoAppDataRoamingnpm-cache_logs2018-06-29T17_22
_12_579Z-debug.log

我一直在寻找同样的问题,但我仍然真正了解问题和解决方案。 这是我找到的帖子:

-bcrypt@1.0.3 安装:"节点预 gyp 安装 --回退到构建":不太明白。

-NPM 安装错误 - 节点预 Gyp :我尝试了npm cache clean --force并再次运行npm i node-gyp仍然相同的错误

附加信息:

->节点版本:10.5.0

->npm 版本:6.1.0

->视窗 10 专业版 64 位

该错误导致我运行ionic serve时出错。错误如下所示:

D:ADAProjectsfoodNinjaClientApp (Jerry-Dev2 -> origin)
λ ionic serve
Error: Node Sass does not yet support your current environment: Windows 64-bit with Unsupported runtime (64)
For more information on which environments are supported please see:
https://github.com/sass/node-sass/releases/tag/v4.7.2
at module.exports (D:ADAProjectsfoodNinjaClientAppnode_modulesnode-sasslibbinding.js:13:13)
at Object.<anonymous> (D:ADAProjectsfoodNinjaClientAppnode_modulesnode-sasslibindex.js:14:35)
at Module._compile (internal/modules/cjs/loader.js:702:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:713:10)
at Module.load (internal/modules/cjs/loader.js:612:32)
at tryModuleLoad (internal/modules/cjs/loader.js:551:12)
at Function.Module._load (internal/modules/cjs/loader.js:543:3)
at Module.require (internal/modules/cjs/loader.js:650:17)
at require (internal/modules/cjs/helpers.js:20:18)
at Object.<anonymous> (D:ADAProjectsfoodNinjaClientAppnode_modules@ionicapp-scriptsdistcorebundle-components.js:6:16)

我真的需要一个指南来解决问题。谢谢。

经过这么多次尝试,我终于解决了这个问题,这个问题只是因为驻留在package.json中的库的版本不匹配。

我刚刚安装了 python 并设置了环境变量,现在它非常适合我。确保已安装 Python 2.7。

安装Python(在窗口中安装时,您可以获得在环境变量中添加路径的选项,只需勾选复选框,否则(

在环境变量中设置路径。

为了验证,打开命令提示符并编写python命令,如果它不会给出任何错误,那么它工作正常。

还要检查 package.json 中的 grpc 版本并使用当前版本更新它。

删除旧node_moules

现在运行npm update

现在执行npm install或运行您的项目。我想现在你的问题解决了。:-)

最新更新