vue 安装各种问题

news2024/9/22 5:37:47

新下载了个项目模板,安装包就遇到了各种各样问题

电脑: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.com

disturl=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.o
  LIBTOOL-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.stamp
  CXX(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.coloradmin.cn/o/1487922.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

rocky使用yum安装msyql8.0

先查看一下源是否有mysql和mysql的版本 yum list mysql* 直接yum install mysql-server 会安装相关7个包 安装完毕后systemctl start mysqld启动mysql 然后mysql_secure_installation配置权限 mysql8的配置稍微有点不一样&#xff0c;按照英文提示来就行&#xff0c;不会的…

rocketmq+rocket-dashboard win10安装部署+注册为Windows服务

1.1 首先去官网下载zip包 选择自己需要的版本 下载 | RocketMQ 1.2 、下载后&#xff0c;解压到指定目录 1.3、配置RocketMQ环境变量 注意&#xff0c;看对应的版本需要jdk版本 1.4、启动mqnameserver 进入bin目录下&#xff0c;双击启动mqnamesrv.cmd 启动后&#xff0c;…

【推荐算法系列十八】:DSSM 召回算法

参考 推荐系统中 DSSM 双塔模型汇总&#xff08;二更&#xff09; DSSM 和 YouTubeDNN 都是比较经典的 U2I 模型。 U2I 召回 U2I 召回也就是 User-to-Item 召回&#xff0c;它基于用户的历史行为以及用户的一些个人信息&#xff0c;对系统中的候选物品进行筛选&#xff0c;挑…

蓝桥杯倒计时 41天 - 二分答案-最大通过数-妮妮的月饼工厂

最大通过数 思路&#xff1a;假设左边能通过 x 关&#xff0c;右边能通过 y 关&#xff0c;x∈[0,n]&#xff0c;通过二分&#xff0c;在前缀和中枚举右边通过的关卡数&#xff0c;保存 xy 的最大值。 #include<bits/stdc.h> using namespace std; typedef long long ll…

价格腰斩,腾讯云2024优惠活动云服务器62元一年,多配置报价

腾讯云服务器多少钱一年&#xff1f;62元一年起&#xff0c;2核2G3M配置&#xff0c;腾讯云2核4G5M轻量应用服务器218元一年、756元3年&#xff0c;4核16G12M服务器32元1个月、312元一年&#xff0c;8核32G22M服务器115元1个月、345元3个月&#xff0c;腾讯云服务器网txyfwq.co…

5、Linux-vi编辑器

目录 一、介绍 二、三种模式 1、命令模式&#xff08;默认&#xff09; 2、插入模式 3、末行模式 4、模式转换 三、基本操作 1、保存文件&#xff08;末行模式下&#xff09; 2、行号&#xff08;末行模式下&#xff09; 3、查找&#xff08;末行模式下&#xff09; …

Python web框架fastapi数据库操作ORM(二)增删改查逻辑实现方法

✨✨ 欢迎大家来到景天科技苑✨✨ &#x1f388;&#x1f388;养成好习惯&#xff0c;先赞后看哦~&#x1f388;&#x1f388; 所属专栏&#xff1a;Fastapi 景天的主页&#xff1a;景天科技苑 上一章&#xff0c;我们讲到了fastapi数据库操作ORM的配置和查询操作&#xff0…

【Matlab深度学习】详解matlab深度学习进行时间序列预测

&#x1f517; 运行环境&#xff1a;Matlab &#x1f6a9; 撰写作者&#xff1a;左手の明天 &#x1f947; 精选专栏&#xff1a;《python》 &#x1f525; 推荐专栏&#xff1a;《算法研究》 &#x1f510;#### 防伪水印——左手の明天 ####&#x1f510; &#x1f497; 大家…

框架漏洞-->Struts2 Docker_Vulnhub搭建

来浅浅的讲一下Struts2漏洞 目录 1.Docker_Vulnhub搭建 2.Struts2 3.Struts2的框架特征 4.S2-029-->Remote Code Execution 5.漏洞复现 1.RCE 2.Getshell 1.Docker_Vulnhub搭建 因为我用的是Linux&#xff0c;所以我选择直接搭个docker&#xff0c;这里我建议先换个…

Jmeter接口测试---随机数、加密、cookie鉴权、断言、CSV参数化

随机数 第一步&#xff1a;选择工具-函数助手对话框 第二步&#xff1a;选择random&#xff0c;设置最大值最小值&#xff0c;复制函数字符串到指定位置 加密接口 类型&#xff1a;AES、DES、Base64、RSA&#xff08;可以解密&#xff09; | MD5、SHA、HmacSHA&#xff08;不…

振弦式埋入应变计:工程安全的精准守护者

振弦式埋入应变计是一种先进的工程监测设备&#xff0c;以其卓越的性能和稳定的可靠性&#xff0c;广泛应用于水工建筑物及其他混凝土结构物的长期安全监测中。峟思振弦埋入式应变计的核心部件采用进口钢弦制成&#xff0c;保证了其使用寿命的长久性。同时&#xff0c;主要构件…

【C++练级之路】【Lv.10】【STL】priority_queue类和反向迭代器的模拟实现

快乐的流畅&#xff1a;个人主页 个人专栏&#xff1a;《C语言》《数据结构世界》《进击的C》 远方有一堆篝火&#xff0c;在为久候之人燃烧&#xff01; 文章目录 一、仿函数1.1 仿函数的介绍1.2 仿函数的优势 二、priority_queue2.1 push2.2 pop2.3 top2.4 size2.5 empty 三、…

延迟任务基于DeyalQueue

一&#xff0c;延迟任务应用场景&#xff1f; 一般用于处理订单&#xff0c;将redis中的数据延迟存入数据库&#xff0c;实现异步存储减少DB的压力 DelayQueue是基于内存的延迟队列 二&#xff0c; 延迟任务的实现方案有很多 DelayQueue Redisson MQ 时间轮 原理 JDK自带延…

基于Keil的RTE(run time environment)配置GD32开发环境,移植FreeRTOS

前言&#xff1a; 10多年前就用STM32了&#xff0c;最近从STM32转到GD32&#xff0c;感觉国产的芯片发展是真的快&#xff0c;不但更便宜&#xff0c;还更快更好用了&#xff08;是在是受不了STM32 I2C BUSY的那个BUG&#xff09;。 先说下&#xff0c;实际上STM32的程序可以…

5 分钟配置好 Electron 应用的图标

最近在开发博客本地客户端 HexoPress&#xff0c;应用做好后&#xff0c;需要打包&#xff0c;如果不希望打包出来 App 的图标用的是 Electron 默认的星球环绕的图标&#xff0c;那么需要自己制作图标。 制作图标 首先&#xff0c;你需要给各种操作系统制作一个满足要求的图标…

Python+OpenGL三维模型显示鼠标缩放旋转平移

程序示例精选 PythonOpenGL三维模型显示鼠标缩放旋转平移 如需安装运行环境或远程调试&#xff0c;见文章底部个人QQ名片&#xff0c;由专业技术人员远程协助&#xff01; 前言 这篇博客针对《PythonOpenGL三维模型显示鼠标缩放旋转平移》编写代码&#xff0c;代码整洁&#…

「MySQL」基本操作类型

&#x1f387;个人主页&#xff1a;Ice_Sugar_7 &#x1f387;所属专栏&#xff1a;数据库 &#x1f387;欢迎点赞收藏加关注哦&#xff01; 数据库的操作 创建、显示数据库 使用 create 创建一个数据库 create database goods;然后可以用 show databases 来查看已经创建的数…

mac电脑使用pyinstaller打包python脚本

pyinstaller -F template.py 出现报错"AssertionError: Executable contains code signature!" 移除签名 codesign --remove-signature /Users/f7692281/PycharmProjects/TPtestlist/transmit_v6.0.py 打包命令 pyinstaller --windowed transmit_v6.0.py pyinst…

【MATLAB】语音信号识别与处理:T1小波滤波算法去噪及谱相减算法呈现频谱

1 基本定义 T1小波滤波算法是一种基于小波变换的信号去噪算法。它可以有效地去除信号中的噪声&#xff0c;并保留信号的主要特征。该算法的主要思想是将信号分解为多个不同尺度的小波系数&#xff0c;然后通过对小波系数进行阈值处理来去除噪声。 具体来说&#xff0c;T1小波滤…

企业CRM系统选型指南 | 掌握必备功能,提升工作效率

大家好我是卡林&#xff0c;今天分享CRM系统的十大功能&#xff0c;企业CRM系统选型指南。说起CRM的功能&#xff0c;大家会联想到什么&#xff1f;数据库、商机管理或者销售漏斗&#xff0c;这些是大部分人都会联想到的功能&#xff0c;但不太全面。如线索管理、联系人管理、客…