Ubuntu系統下 npm install -g tauri 報錯問題處理

處理在安裝 Tauri 時遇到的問題,可以按照以下步驟進行操作

 npm install -g tauri
npm warn deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
npm warn deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
npm warn deprecated q@1.5.1: You or someone you depend on is using Q, the JavaScript Promise library that gave JavaScript developers strong feelings about promises. They can almost certainly migrate to the native JavaScript promise now. Thank you literally everyone for joining me in this bet against the odds. Be excellent to each other.
npm warn deprecated
npm warn deprecated (For a CapTP with native promises, see @endo/eventual-send and @endo/captp)
npm warn deprecated are-we-there-yet@1.1.7: This package is no longer supported.
npm warn deprecated npmlog@4.1.2: This package is no longer supported.
npm warn deprecated har-validator@5.1.5: this library is no longer supported
npm warn deprecated gauge@2.7.4: This package is no longer supported.
npm warn deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm warn deprecated w3c-hr-time@1.0.2: Use your platform's native performance.now() and performance.timeOrigin.
npm warn deprecated request-promise-native@1.0.9: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
npm warn deprecated domexception@2.0.1: Use your platform's native DOMException instead
npm warn deprecated abab@2.0.6: Use your platform's native atob() and btoa() methods instead
npm warn deprecated rimraf@2.7.1: Rimraf versions prior to v4 are no longer supported
npm warn deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm warn deprecated @tauri-apps/tauri-inliner@1.14.1: Tauri now uses a custom protocol for asset loading so this package is not used anymore.
npm warn deprecated svgo@1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x.
npm error code 1
npm error path /root/.nvm/versions/node/v20.18.1/lib/node_modules/tauri/node_modules/sharp
npm error command failed
npm error command sh -c (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)
npm error make: Entering directory '/root/.nvm/versions/node/v20.18.1/lib/node_modules/tauri/node_modules/sharp/build'
npm error   CC(target) Release/obj.target/nothing/../node-addon-api/nothing.o
npm error rm -f Release/obj.target/../node-addon-api/nothing.a Release/obj.target/../node-addon-api/nothing.a.ar-file-list; mkdir -p `dirname Release/obj.target/../node-addon-api/nothing.a`
npm error ar crs Release/obj.target/../node-addon-api/nothing.a @Release/obj.target/../node-addon-api/nothing.a.ar-file-list
npm error   COPY Release/nothing.a
npm error   TOUCH Release/obj.target/libvips-cpp.stamp
npm error   CXX(target) Release/obj.target/sharp/src/common.o
npm error make: Leaving directory '/root/.nvm/versions/node/v20.18.1/lib/node_modules/tauri/node_modules/sharp/build'
npm error info sharp Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.10.5/libvips-8.10.5-linux-x64.tar.br
npm error ERR! sharp Request timed out
npm error info sharp Attempting to build from source via node-gyp but this may fail due to the above error
npm error info sharp Please see https://sharp.pixelplumbing.com/install for required dependencies
npm error gyp info it worked if it ends with ok
npm error gyp info using node-gyp@10.1.0
npm error gyp info using node@20.18.1 | linux | x64
npm error gyp info find Python using Python version 3.10.12 found at "/usr/bin/python3"
npm error gyp http GET https://nodejs.org/download/release/v20.18.1/node-v20.18.1-headers.tar.gz
npm error gyp http 200 https://nodejs.org/download/release/v20.18.1/node-v20.18.1-headers.tar.gz
npm error gyp http GET https://nodejs.org/download/release/v20.18.1/SHASUMS256.txt
npm error gyp http 200 https://nodejs.org/download/release/v20.18.1/SHASUMS256.txt
npm error gyp info spawn /usr/bin/python3
npm error gyp info spawn args [
npm error gyp info spawn args '/root/.nvm/versions/node/v20.18.1/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
npm error gyp info spawn args 'binding.gyp',
npm error gyp info spawn args '-f',
npm error gyp info spawn args 'make',
npm error gyp info spawn args '-I',
npm error gyp info spawn args '/root/.nvm/versions/node/v20.18.1/lib/node_modules/tauri/node_modules/sharp/build/config.gypi',
npm error gyp info spawn args '-I',
npm error gyp info spawn args '/root/.nvm/versions/node/v20.18.1/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm error gyp info spawn args '-I',
npm error gyp info spawn args '/root/.cache/node-gyp/20.18.1/include/node/common.gypi',
npm error gyp info spawn args '-Dlibrary=shared_library',
npm error gyp info spawn args '-Dvisibility=default',
npm error gyp info spawn args '-Dnode_root_dir=/root/.cache/node-gyp/20.18.1',
npm error gyp info spawn args '-Dnode_gyp_dir=/root/.nvm/versions/node/v20.18.1/lib/node_modules/npm/node_modules/node-gyp',
npm error gyp info spawn args '-Dnode_lib_file=/root/.cache/node-gyp/20.18.1/<(target_arch)/node.lib',
npm error gyp info spawn args '-Dmodule_root_dir=/root/.nvm/versions/node/v20.18.1/lib/node_modules/tauri/node_modules/sharp',
npm error gyp info spawn args '-Dnode_engine=v8',
npm error gyp info spawn args '--depth=.',
npm error gyp info spawn args '--no-parallel',
npm error gyp info spawn args '--generator-output',
npm error gyp info spawn args 'build',
npm error gyp info spawn args '-Goutput_dir=.'
npm error gyp info spawn args ]
npm error gyp info spawn make
npm error gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm error <command-line>: warning: "_GLIBCXX_USE_CXX11_ABI" redefined
npm error <command-line>: note: this is the location of the previous definition
npm error ../src/common.cc:24:10: fatal error: vips/vips8: No such file or directory
npm error    24 | #include <vips/vips8>
npm error       |          ^~~~~~~~~~~~
npm error compilation terminated.
npm error make: *** [sharp.target.mk:136: Release/obj.target/sharp/src/common.o] Error 1
npm error gyp ERR! build error 
npm error gyp ERR! stack Error: `make` failed with exit code: 2
npm error gyp ERR! stack at ChildProcess.<anonymous> (/root/.nvm/versions/node/v20.18.1/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:209:23)
npm error gyp ERR! System Linux 5.15.0-113-generic
npm error gyp ERR! command "/root/.nvm/versions/node/v20.18.1/bin/node" "/root/.nvm/versions/node/v20.18.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm error gyp ERR! cwd /root/.nvm/versions/node/v20.18.1/lib/node_modules/tauri/node_modules/sharp
npm error gyp ERR! node -v v20.18.1
npm error gyp ERR! node-gyp -v v10.1.0
npm error gyp ERR! not ok

處理在安裝 Tauri 時遇到的問題,可以按照以下步驟進行操作:

1. 安裝 sharp 所需的系統依賴

sharp 庫需要一些系統依賴項。根據您使用的 Linux 發行版,您可以使用以下命令安裝這些依賴項:

對于 Ubuntu/Debian:

sudo apt-get update
sudo apt-get install -y build-essential libvips-dev

對于 Fedora:

sudo dnf install -y gcc-c++ make vips-devel

對于 Arch Linux:

sudo pacman -S --needed base-devel vips

2. 清除 npm 緩存

有時,清除 npm 緩存可以幫助解決安裝問題:

npm cache clean --force

3. 重新安裝 Tauri

安裝完所需的依賴項后,嘗試重新安裝 Tauri:

npm install -g tauri

4. 檢查 Node.js 和 npm 版本

確保您使用的是兼容的 Node.js 和 npm 版本。Tauri 通常與 LTS 版本的 Node.js 配合良好。您可以使用以下命令檢查版本:

node -v
npm -v

如果需要切換 Node.js 版本,可以使用 nvm(Node 版本管理器)安裝不同的版本:

nvm install --lts
nvm use --lts

5. 使用 Yarn 作為替代

如果您繼續遇到 npm 的問題,可以嘗試使用 Yarn 作為替代的包管理器:

npm install -g yarn
yarn global add tauri

6. 檢查網絡問題

錯誤信息中提到的 Request timed out 表示可能存在網絡問題。確保您的互聯網連接穩定,并且沒有防火墻或代理設置阻止請求。

7. 查看日志文件

如果安裝再次失敗,請檢查錯誤輸出中提到的日志文件,以獲取更多詳細信息。

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/web/63934.shtml
繁體地址,請注明出處:http://hk.pswp.cn/web/63934.shtml
英文地址,請注明出處:http://en.pswp.cn/web/63934.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

信貸域——互聯網金融理論基礎

摘要 互聯網金融這種新興的金融業態近幾年飛速發展&#xff0c;規模不斷擴大&#xff0c;互聯網金融在對我國金融體系和經濟發展影響中所占的分量越來越重&#xff0c;一定程度上也推動了互聯網金融理論的發展。 互聯網金融與傳統金融都是金融&#xff0c;有著相近的理論基礎。…

C++軟件設計模式之享元模式(FlyWeight)

享元&#xff08;Flyweight&#xff09;模式的動機與意圖 動機 享元模式的主要動機是通過共享對象來減少內存使用&#xff0c;從而提高系統的性能。在某些情況下&#xff0c;系統中可能有大量細粒度的對象&#xff0c;這些對象具有共同的部分狀態&#xff0c;而這些狀態可以共…

LightGBM分類算法在醫療數據挖掘中的深度探索與應用創新(上)

一、引言 1.1 醫療數據挖掘的重要性與挑戰 在當今數字化醫療時代,醫療數據呈爆炸式增長,這些數據蘊含著豐富的信息,對醫療決策具有極為重要的意義。通過對醫療數據的深入挖掘,可以發現潛在的疾病模式、治療效果關聯以及患者的健康風險因素,從而為精準醫療、個性化治療方…

|-牛式-|

題目描述 下面是一個乘法豎式&#xff0c;如果用我們給定的那幾個數字來取代 * &#xff0c;可以使式子成立的話&#xff0c;我們就叫這個式子牛式。 * * * x * * ------- * * * * * * ------- * * * * 數字只能取代 * &#xff0c;當然第一位不能為 0 。 寫一個程序找…

es 3期 第18節-分頁查詢使用避坑的一些事

#### 1.Elasticsearch是數據庫&#xff0c;不是普通的Java應用程序&#xff0c;傳統數據庫需要的硬件資源同樣需要&#xff0c;提升性能最有效的就是升級硬件。 #### 2.Elasticsearch是文檔型數據庫&#xff0c;不是關系型數據庫&#xff0c;不具備嚴格的ACID事務特性&#xff…

STM32串口第一次接收數據時第一個字節丟失的問題

解決方法&#xff1a;開啟中斷之前&#xff0c;先清除標志位【1】。 串口清除標志位&#xff1a; __HAL_UART_CLEAR_PEFLAG(&huart1); HAL_UART_Receive_IT(&huart1,&RxUart, 1); 定時器清除標志位&#xff1a; __HAL_TIM_CLEAR_FLAG(&htim3,TIM_FLAG_UPDATE);…

深度學習中的殘差網絡、加權殘差連接(WRC)與跨階段部分連接(CSP)詳解

隨著深度學習技術的不斷發展&#xff0c;神經網絡架構變得越來越復雜&#xff0c;而這些復雜網絡在訓練時常常遇到梯度消失、梯度爆炸以及計算效率低等問題。為了克服這些問題&#xff0c;研究者們提出了多種網絡架構&#xff0c;包括 殘差網絡&#xff08;ResNet&#xff09;、…

Pytorch | 從零構建EfficientNet對CIFAR10進行分類

Pytorch | 從零構建EfficientNet對CIFAR10進行分類 CIFAR10數據集EfficientNet設計理念網絡結構性能特點應用領域發展和改進 EfficientNet結構代碼詳解結構代碼代碼詳解MBConv 類初始化方法前向傳播 forward 方法 EfficientNet 類初始化方法前向傳播 forward 方法 訓練過程和測…

Vue 2 中實現雙擊事件的幾種方法

在 Vue 2 中處理用戶交互&#xff0c;特別是雙擊事件&#xff0c;是一個常見的需求。Vue 提供了一種簡潔的方式來綁定事件&#xff0c;包括雙擊事件。本文將介紹幾種在 Vue 2 中實現雙擊事件的方法。 1. 使用 dblclick 指令 Vue 允許你直接在模板中使用 dblclick 指令來監聽雙…

音視頻入門基礎:MPEG2-TS專題(20)——ES流簡介

《T-REC-H.222.0-202106-S!!PDF-E.pdf》第27頁對ES進行了定義。ES流是PES packets&#xff08;PES包&#xff09;中編碼的視頻、編碼的音頻或其他編碼的比特流。一個ES流&#xff08;elementary stream&#xff09;在具有且只有一個stream_id的PES packets序列中攜帶&#xff1…

天水月亮圈圈:舌尖上的歷史與傳承

在天水甘谷縣&#xff0c;有一種美食如同夜空中的明月&#xff0c;散發著獨特的魅力&#xff0c;它就是有著百年歷史的月亮圈圈。月亮圈圈原名甘谷酥圈圈&#xff0c;據傳&#xff0c;由大像山鎮蔣家莊一姓李的廚師創制而成&#xff0c;后經王明玖等廚師的光大傳承&#xff0c;…

YOLOv11融合[CVPR2023]FFTformer中的FSAS模塊

YOLOv11v10v8使用教程&#xff1a; YOLOv11入門到入土使用教程 YOLOv11改進匯總貼&#xff1a;YOLOv11及自研模型更新匯總 《Efficient Frequency Domain-based Transformers for High-Quality Image Deblurring》 一、 模塊介紹 論文鏈接&#xff1a;https://arxiv.org/abs…

java如何使用poi-tl在word模板里渲染多張圖片

1、poi-tl官網地址 http://deepoove.com/poi-tl/ 2、引入poi-tl的依賴 <dependency><groupId>com.deepoove</groupId><artifactId>poi-tl</artifactId><version>1.12.1</version></dependency>3、定義word模板 釋義&#xf…

《信管通低代碼信息管理系統開發平臺》Windows環境安裝說明

1 簡介 《信管通低代碼信息管理系統應用平臺》提供多環境軟件產品開發服務&#xff0c;包括單機、局域網和互聯網。我們專注于適用國產硬件和操作系統應用軟件開發應用。為事業單位和企業提供行業軟件定制開發&#xff0c;滿足其獨特需求。無論是簡單的應用還是復雜的系統&…

8K+Red+Raw+ProRes422分享5個影視級視頻素材網站

Hello&#xff0c;大家好&#xff0c;我是后期圈&#xff01; 在視頻創作中&#xff0c;電影級的視頻素材能夠為作品增添專業質感&#xff0c;讓畫面更具沖擊力。無論是廣告、電影短片&#xff0c;還是品牌宣傳&#xff0c;高質量的視頻素材都是不可或缺的資源。然而&#xff…

Git遠程倉庫的使用

一.遠程倉庫注冊 1.github&#xff1a;GitHub Build and ship software on a single, collaborative platform GitHub 2.gitee&#xff1a;GitHub Build and ship software on a single, collaborative platform GitHub github需要使用魔法&#xff0c;而gitee是國內的倉…

Echarts連接數據庫,實時繪制圖表詳解

文章目錄 Echarts連接數據庫&#xff0c;實時繪制圖表詳解一、引言二、步驟一&#xff1a;環境準備與數據庫連接1、環境搭建2、數據庫連接 三、步驟二&#xff1a;數據獲取與處理1、查詢數據庫2、數據處理 四、步驟三&#xff1a;ECharts圖表配置與渲染1、配置ECharts選項2、動…

MongoDB 常用操作指南(Docker 環境下)

本文詳細介紹如何在 Docker 中操作 MongoDB&#xff0c;包括如何進入命令行、進行用戶認證、查看數據庫和集合&#xff0c;以及常用的索引操作和其他高頻使用的 MongoDB 方法。小白也能輕松上手 1. 在 Docker 中進入 MongoDB 命令行 進入運行 MongoDB 容器的命令行&#xff1a;…

【Java基礎面試題038】棧和隊列在Java中的區別是什么?

回答重點 棧&#xff08;Stack&#xff09;&#xff1a;遵循后進先出&#xff08;LIFO&#xff0c;Last In&#xff0c;First Out&#xff09;原則。即&#xff0c;最后插入的元素最先被移除。主要操作包括push&#xff08;入棧&#xff09;和pop&#xff08;出棧&#xff09;…

idea2024創建JavaWeb項目以及配置Tomcat詳解

今天呢&#xff0c;博主的學習進度也是步入了JavaWeb&#xff0c;目前正在逐步楊帆旗航&#xff0c;迎接全新的狂潮海浪。 那么接下來就給大家出一期有關JavaWeb的配置教學&#xff0c;希望能對大家有所幫助&#xff0c;也特別歡迎大家指點不足之處&#xff0c;小生很樂意接受正…