簡體   English   中英

npm期間的錯誤i:node-pre-gyp install --fallback-to-build --library = static_library

[英]Error during npm i : node-pre-gyp install --fallback-to-build --library=static_library

我知道我不應該只是提出這樣的問題,並希望我能提供更多信息,但我真的不知道它是什么,這也是我第一次遇到這樣的問題(換到新的筆記本電腦后),我想現在我只有在有人要求我提供更多信息之前,才能提供錯誤消息。

下面是運行npm i時我的cmder中的錯誤顯示

D:\ADA\Projects\foodNinjaCustomerApp (Jerry-Dev2 -> origin)                    
λ npm i                                                                        

> grpc@1.10.0 install D:\ADA\Projects\foodNinjaCustomerApp\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-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\
nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:483:19)         
     at PythonFinder.failNoPython (D:\Program File\nodejs\node_modules\npm\node
_modules\node-gyp\lib\configure.js:483:19)                                     
gypgyp  ERR!ERR!  stackstack     at PythonFinder.<anonymous> (D:\Program File\n
odejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:508:16)          
     at PythonFinder.<anonymous> (D:\Program File\nodejs\node_modules\npm\node_
modules\node-gyp\lib\configure.js:508:16)                                      
gypgyp  ERR!ERR!  stackstack     at D:\Program File\nodejs\node_modules\npm\nod
e_modules\graceful-fs\polyfills.js:284:29                                      
     at D:\Program File\nodejs\node_modules\npm\node_modules\graceful-fs\polyfi
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:\ADA\Projects\foodNinjaCustomerApp\node_modules\grpc
 D:\ADA\Projects\foodNinjaCustomerApp\node_modules\grpc                        
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 File\nodejs\node.e
xe D:\Program File\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.j
s configure --fallback-to-build --library=static_library --module=D:\ADA\Projec
ts\foodNinjaCustomerApp\node_modules\grpc\src\node\extension_binary\node-v64-wi
n32-x64-unknown\grpc_node.node --module_name=grpc_node --module_path=D:\ADA\Pro
jects\foodNinjaCustomerApp\node_modules\grpc\src\node\extension_binary\node-v64
-win32-x64-unknown' (1)                                                        
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (D:\ADA\Projects\foodNi
njaCustomerApp\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/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:\ADA\Projects\foodNinjaCustomerApp\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:\ADA\Projects\foodNinjaCustomerApp\node_mo
dules\grpc\src\node\extension_binary\node-v64-win32-x64-unknown\grpc_node.node 
--module_name=grpc_node --module_path=D:\ADA\Projects\foodNinjaCustomerApp\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\fs
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:\Users\jerry.ho\AppData\Roaming\npm-cache\_logs\2018-06-29T17_22
_12_579Z-debug.log

我一直在尋找同樣的問題,但我仍然非常了解問題和解決方案。 這是我找到的帖子:

- bcrypt@1.0.3安裝:`node-pre-gyp install --fallback-to-build` :真的不明白。

- NPM安裝錯誤 - Node-Pre-Gyp :我試過npm cache clean --force並再次運行npm i node-gyp仍然是同樣的錯誤

附加信息:

- >節點版本:10.5.0

- > npm版本:6.1.0

- > windows 10 Pro 64bit

該錯誤導致我有錯誤運行ionic serve 錯誤如下所示:

D:\ADA\Projects\foodNinjaClientApp (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:\ADA\Projects\foodNinjaClientApp\node_modules\node-sass\lib\binding.js:13:13)
    at Object.<anonymous> (D:\ADA\Projects\foodNinjaClientApp\node_modules\node-sass\lib\index.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:\ADA\Projects\foodNinjaClientApp\node_modules\@ionic\app-scripts\dist\core\bundle-components.js:6:16)

我真的需要一個解決問題的指南..謝謝。

經過這么多嘗試后我終於解決了這個問題,而這個問題只是因為函數庫的版本不匹配而存在於package.json中。

我剛剛安裝了python並設置了環境變量,現在它對我來說非常合適。確保你已經安裝了Python 2.7。

安裝Python(在Windows中安裝時,您可以獲得在環境變量中添加路徑的選項,只需選中復選框或其他)

在環境變量中設置路徑。

為驗證打開命令提示符並編寫python命令,如果它不會給出任何錯誤,那么它正常工作。

還要檢查package.json中的grpc版本並使用當前版本進行更新。

刪除舊的node_moules

現在運行npm update

現在做npm install或運行你的項目。 我想現在你的問題已經解決了。 :-)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM