当前位置:网站首页>NPM cannot install sharp
NPM cannot install sharp
2022-07-06 22:33:00 【User 6256742】
sharp The package is based on node.js High performance image processor
But in use npm/yarn Yes sharp Installation failures often occur during installation , The main reason is the problem of installing the source, so we can choose to change the source for the package manager or download and install it manually .
Source change
Only one of the three commands can be executed
- Use mirror address ( Set only sharp):
npm config set sharp_binary_host "https://npmmirror.com/mirrors/sharp"
npm config set sharp_libvips_binary_host "https://npmmirror.com/mirrors/sharp-libvips"
- It is recommended that npm The source is modified to cnpm
npm config set registry https://registry.npmmirror.com
- yarn Modify the way
yarn config set registry https://registry.npmmirror.com
Manual Download
- Download ahead of time sharp A version number corresponds to libvips Dependency package , Put it in npm In the cache path of , Usually this path is
/Users/<username>/.npm/_libvips
( In the use of the nvm management node In the case of version , Execute... Under normal circumstances 1 There will be no problem after the operation )
If you don't download it in advance and put it in the cache , The following error messages may appear
info sharp Using cached /Users/<usernmae>/.npm/_libvips/libvips-8.10.0-darwin-x64.tar.br
ERR! sharp Decompression failed
info sharp Attempting to build from source via node-gyp but this may fail due to the above error
info sharp Please see https://sharp.pixelplumbing.com/install for required dependencies
TOUCH Release/obj.target/libvips-cpp.stamp
CC(target) Release/obj.target/nothing/node_modules/node-addon-api/nothing.o
LIBTOOL-STATIC Release/nothing.a
CXX(target) Release/obj.target/sharp/src/common.o
../src/common.cc:24:10: fatal error: 'vips/vips8' file not found
#include <vips/vips8>
^~~~~~~~~~~~
1 error generated.
make: *** [Release/obj.target/sharp/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 (/Users/maxingyuan/.nvm/versions/node/v12.16.1/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:311:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Darwin 19.6.0
gyp ERR! command "/Users/<usernmae>/.nvm/versions/node/v12.16.1/bin/node" "/Users/<usernmae>/.nvm/versions/node/v12.16.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/maxingyuan/.nvm/versions/node/v12.16.1/lib/node_modules/sharp
gyp ERR! node -v v12.16.1
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `(node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/<usernmae>/.npm/_logs/2020-11-11T07_51_13_893Z-debug.log
For specific source change, please refer to the article :npm、yarn Switch Taobao source
边栏推荐
猜你喜欢
rust知识思维导图xmind
手写ABA遇到的坑
Senior soft test (Information System Project Manager) high frequency test site: project quality management
自定义 swap 函数
自制J-Flash烧录工具——Qt调用jlinkARM.dll方式
Spatial domain and frequency domain image compression of images
signed、unsigned关键字
【LeetCode】19、 删除链表的倒数第 N 个结点
[leetcode] 19. Delete the penultimate node of the linked list
网络基础入门理解
随机推荐
小程序系统更新提示,并强制小程序重启并使用新版本
Anaconda installs third-party packages
柔性数组到底如何使用呢?
Inno setup packaging and signing Guide
Aardio - 封装库时批量处理属性与回调函数的方法
Crawler obtains real estate data
LeetCode 练习——剑指 Offer 26. 树的子结构
Aardio - construct a multi button component with customplus library +plus
金融人士必读书籍系列之六:权益投资(基于cfa考试内容大纲和框架)
C# 三种方式实现Socket数据接收
OpenNMS分离数据库
China 1,4-cyclohexanedimethanol (CHDM) industry research and investment decision-making report (2022 Edition)
uniapp设置背景图效果demo(整理)
Aardio - 利用customPlus库+plus构造一个多按钮组件
Unity3d minigame unity webgl transform plug-in converts wechat games to use dlopen, you need to use embedded 's problem
Mise en place d'un environnement de développement OP - tee basé sur qemuv8
pytorch_ Yolox pruning [with code]
【雅思口语】安娜口语学习记录part1
The nearest common ancestor of binary (search) tree ●●
SQL server generates auto increment sequence number