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.mzph.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中的作用我们可以分为三个部分 全局作用域函数作用域块级作用域 全局作用域 不在任何函数内部或者大括号中声明的变量,都是再全局作用域下,全局声明的变量可以在程序中的任何位置访问 函数作用域 函数作用域也叫局部作用域,如果一个变量声名在一个函数内部,那么它…