vue 安裝各種問題

新下載了個項目模板,安裝包就遇到了各種各樣問題

電腦:mac

使用npm i 等命令一直安裝項目,然后一直報錯

2534 info run canvas@2.11.2 install node_modules/canvas node-pre-gyp install --fallback-to-build --update-binary
2535 info run sharp@0.32.6 install node_modules/sharp (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy)
2536 info run sharp@0.32.6 install { code: 1, signal: null }
2537 timing reify:rollback:createSparse Completed in 4602ms
2538 timing reify:rollback:retireShallow Completed in 0ms
2539 timing command:install Completed in 41771ms
2540 verbose stack Error: command failed
2540 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/lib/index.js:63:27)
2540 verbose stack     at ChildProcess.emit (node:events:513:28)
2540 verbose stack     at maybeClose (node:internal/child_process:1093:16)
2540 verbose stack     at Socket.<anonymous> (node:internal/child_process:451:11)
2540 verbose stack     at Socket.emit (node:events:513:28)
2540 verbose stack     at Pipe.<anonymous> (node:net:757:14)
2541 verbose pkgid sharp@0.32.6
2542 verbose cwd /Users/apple/Desktop/公司/jhtt-new/link-we-chat-front/vue3-lw-pc
2543 verbose Darwin 20.3.0
2544 verbose node v16.17.0
2545 verbose npm  v8.15.0
2546 error code 1
2547 error path /Users/apple/Desktop/公司/jhtt-new/link-we-chat-front/vue3-lw-pc/node_modules/sharp
2548 error command failed
2549 error command sh /var/folders/9c/hdh5sy1x1vd8qp5l4939z_zr0000gn/T/install-7bd83f7d.sh
2550 error sharp: Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.14.5/libvips-8.14.5-darwin-x64.tar.br
2550 error sharp: Please see https://sharp.pixelplumbing.com/install for required dependencies
2551 error sharp: Installation error: socket hang up

我百度了關于npm安裝sharp失敗/canvas失敗的解決辦法,改了 .npmrc文件的鏡像

registry=https://registry.npmmirror.comdisturl=https://registry.npmmirror.com/-/binary/node/
# node-sass預編譯二進制文件下載地址
sass_binary_site=https://registry.npmmirror.com/-/binary/node-sass
# sharp預編譯共享庫, 截止2022-09-20 sharp@0.31.0的預編譯共享庫并未同步到鏡像, 入安裝失敗可切換到sharp@0.30.7使用
sharp_libvips_binary_host=https://registry.npmmirror.com/-/binary/sharp-libvips
python_mirror=https://registry.npmmirror.com/-/binary/python/
electron_mirror=https://registry.npmmirror.com/-/binary/electron/
electron_builder_binaries_mirror=https://registry.npmmirror.com/-/binary/electron-builder-binaries/
# 無特殊配置參考{pkg-name}_binary_host_mirror={mirror}
canvas_binary_host_mirror=https://registry.npmmirror.com/-/binary/canvas
node_sqlite3_binary_host_mirror=https://registry.npmmirror.com/-/binary/sqlite3
better_sqlite3_binary_host_mirror=https://registry.npmmirror.com/-/binary/better-sqlite3

但是依舊沒起效果.

最后我改變了思路:安裝了yarn
?

 npm i yarn -g

使用 yarn 進行安裝,但是又出來另一個錯誤

gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]CC(target) Release/obj.target/nothing/../node-addon-api/nothing.oLIBTOOL-STATIC Release/nothing.a
warning: /Library/Developer/CommandLineTools/usr/bin/libtool: archive library: Release/nothing.a the table of contents is empty (no object file members in the library define global symbols)TOUCH Release/obj.target/libvips-cpp.stampCXX(target) Release/obj.target/sharp-darwin-x64/src/common.o
../src/common.cc:13:10: fatal error: 'vips/vips8' file not found
#include <vips/vips8>^~~~~~~~~~~~
1 error generated.
make: *** [Release/obj.target/sharp-darwin-x64/src/common.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
gyp ERR! System Darwin 20.3.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/apple/Desktop/公司/jhtt-new/link-we-chat-front/vue3-lw-pc/node_modules/sharp

找到了這篇文章

npm安裝sharp出現的問題(安裝失敗的問題及解決)_npm sharp-CSDN博客

使用了兩行命令成功了:

npm config set sharp_binary_host "https://npmmirror.com/mirrors/sharp"
npm config set sharp_libvips_binary_host "https://npmmirror.com/mirrors/sharp-libvips"

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

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

相關文章

vscode + visual studio keymap插件

備注&#xff1a;主要推薦代碼遞歸折疊代碼展開單個函數折疊單個代碼展開。原因&#xff1a;vscode中的visual studio keymap插件對于代碼折疊支持不充分&#xff0c;查看大型項目時不方便。 一、個人快捷鍵推薦 1、前進&#xff1a;ctrl shift - 2、回退&#xff1a;ctrl…

uni-app webview 打開baidu.com

在uni-app中&#xff0c;你可以使用web-view組件來打開外部網頁&#xff0c;比如百度首頁。以下是一個簡單的示例代碼&#xff0c;展示了如何在uni-app中使用web-view組件打開百度首頁&#xff1a; <template> <view> <web-view :src"baiduUrl">&l…

【new IntersectionObserver】vue3 數據懶加載

new IntersectionObserver js方法描述步驟 實現邏輯&#xff1a;通過監視底部節點可視情況&#xff0c;獲取新數據進行渲染&#xff0c;如果獲取不到最新數據則顯示暫無其他數據 new IntersectionObserver 是用于監視元素可見度&#xff0c;所以我們只需要監視數據下方的dom是…

ubuntu docker deamon無法連接的問題

現象 ubuntu 下使用docker&#xff0c;禿然一天報了一個錯誤 Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? 排查 排查了半天&#xff0c;是dockerd啟動的時候指定的API listen 和默認的不一致。 systemctl 啟動的時…

【JS】indexedDB基本入門使用;

本文基本僅做個人簡單學習記錄&#xff1b; 相關TS類型&#xff1a; IDBDatabase&#xff1a;open成功后的 result 為 IDBDatabase類型 > idb.result; transaction&#xff1a; transaction(storeNames: string | string[], mode?: IDBTransactionMode, options?: IDBTr…

C++入門全集(4):類與對象【下】

一、再談構造函數 1.1 構造函數體內賦值 我們知道&#xff0c;在創建對象時&#xff0c;編譯器會自動調用構造函數給對象中的各個成員變量一個合適的初始值 class Date { public:Date(int year, int month, int day){_year year;_month month;_day day;}private:int _yea…

windows zip壓縮報錯includes characters that cannot be used in a compressed folder

Windows 用 zip 壓縮文件夾時報錯&#xff1a; <文件> cannot be compressed because includes characters that cannot be used in a compressed folder, such as <非法字符>. You should rename this file or directory.同 [1]。考慮用 python 批量檢測非 ascii…

SOCKS55代理 VS Http代理,如何選擇?

在使用IPFoxy全球代理時&#xff0c;選擇 SOCKS55代理還是HTTP代理&#xff1f;IPFoxy代理可以SOCKS55、Http協議自主切換&#xff0c;但要怎么選擇&#xff1f;為解決這個問題&#xff0c;得充分了解兩種代理的工作原理和配置情況。 在這篇文章中&#xff0c;我們會簡要介紹 …

我常用的大模型和Prompt有哪些?

常用的大模型及其對比 以前提到過&#xff0c;我們公司鼓勵大家多使用GPT這樣的大模型&#xff0c;一方面能夠提高工作效率&#xff0c;一方面使用的越多&#xff0c;越了解&#xff0c;越有可能發現應該怎么將其跟我們公司的產品結合起來。 但是出于安全考慮&#xff0c;如果…

Synchronized 詳解(一)

在C程序代碼中我們可以利用操作系統提供的互斥鎖來實現同步塊的互斥訪問及線程的阻塞及喚醒等工作。在Java中除了提供Lock API外還在語法層面上提供了synchronized關鍵字來實現互斥同步原語,本文將對synchronized關鍵字詳細分析。 帶著問題去理解Synchronized 提示 請帶著這…

10、BossCms代碼審計

1、任意文件上傳 限制 復現 POST /system/extend/ueditor/php/controller.php?actionuploadfile&encodeutf-8 HTTP/1.1 Host: bosscms.com Content-Length: 761 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome…

為什么要學習三維GIS開發?從技術層面告訴你答案

大家都知道GIS開發屬于GIS行業中就業薪資較高的崗位&#xff0c;并且測繪、遙感以及城規等相關專業的畢業生紛紛轉行做webgis開發。 那么&#xff0c;今天小編從技術層面探討一下&#xff0c;為什么建議大家不要僅僅停留在webgis&#xff0c;而要繼續往前學習三維GIS開發&…

TSINGSEE青犀AI智能分析網關V4智慧油田安全生產監管方案

一、方案背景 隨著科技的不斷發展&#xff0c;視頻監控技術在油田行業中得到了廣泛應用。為了提高油田生產的安全性和效率&#xff0c;建設一套智能視頻監控平臺保障安全生產顯得尤為重要。本方案采用先進的視頻分析技術、物聯網技術、云計算技術、大數據和人工智能技術&#…

Linux設備模型(十) - bus/device/device_driver/class

四&#xff0c;驅動的注冊 1&#xff0c;struct device_driver結構體 /** * struct device_driver - The basic device driver structure * name: Name of the device driver. * bus: The bus which the device of this driver belongs to. * owner: The module own…

JavaWeb Tomcat啟動、部署、配置、集成IDEA

web服務器軟件 服務器是安裝了服務器軟件的計算機&#xff0c;在web服務器軟件中&#xff0c;可以部署web項目&#xff0c;讓用戶通過瀏覽器來訪問這些項目。 Web服務器是一個應用程序&#xff08;軟件&#xff09;&#xff0c;對HTTP協議的操作進行封裝&#xff0c;使得程序…

MATLAB讀取txt文本數據及可視化指南

MATLAB讀取txt文本數據的說明指南 目錄 MATLAB讀取txt文本數據的說明指南摘要1. 數據準備2. 讀取數據3. 繪制圖形4. 小結 摘要 在MATLAB中&#xff0c;讀取txt文本格式文件數據是一項基本的操作&#xff0c;特別是在數據分析和可視化方面。本文將介紹如何使用MATLAB讀取txt文本…

C++ 基礎知識

一. 預備知識 1. C的編程方式 過程性語言 (結構化、自頂向下)、面向對象語言、泛型編程 (創建獨立于類型的代碼) 2. 創建源代碼文件的技巧 擴展名&#xff1a;.cpp 二. 第一個程序 - HelloWorld main() 入口點 返回 int 標準庫 iostream std: 標準庫的縮寫 Statement…

HarmonyOS-使用call事件拉起指定UIAbility到后臺

使用call事件拉起指定UIAbility到后臺 許多應用希望借助卡片的能力&#xff0c;實現和應用在前臺時相同的功能。例如音樂卡片&#xff0c;卡片上提供播放、暫停等按鈕&#xff0c;點擊不同按鈕將觸發音樂應用的不同功能&#xff0c;進而提高用戶的體驗。在卡片中使用postCardA…

科技的成就(五十七)

535、Machine Learning "1959 年 7 月&#xff0c;塞繆爾首創 Machine Learning 一詞。塞繆爾在“Some Studies in Machine Learning Using theGame of Checkers”一文中給 Machine Learning 下了個非正式定義&#xff1a;沒有明確編程指令的情況下&#xff0c;能讓計算機…

【js中的作用域】

理解 js中的作用我們可以分為三個部分 全局作用域函數作用域塊級作用域 全局作用域 不在任何函數內部或者大括號中聲明的變量,都是再全局作用域下,全局聲明的變量可以在程序中的任何位置訪問 函數作用域 函數作用域也叫局部作用域,如果一個變量聲名在一個函數內部,那么它…