当前位置:网站首页>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.comManual 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.logFor specific source change, please refer to the article :npm、yarn Switch Taobao source
边栏推荐
- 做接口测试都测什么?有哪些通用测试点?
- Unity3d minigame unity webgl transform plug-in converts wechat games to use dlopen, you need to use embedded 's problem
- Void keyword
- How do I write Flask's excellent debug log message to a file in production?
- Aardio - 封装库时批量处理属性与回调函数的方法
- Daily question 1: force deduction: 225: realize stack with queue
- Adavit -- dynamic network with adaptive selection of computing structure
- Signed and unsigned keywords
- Balanced Multimodal Learning via On-the-fly Gradient Modulation(CVPR2022 oral)
- The difference between enumeration and define macro
猜你喜欢

CCNA Cisco network EIGRP protocol

自制J-Flash烧录工具——Qt调用jlinkARM.dll方式

UE4蓝图学习篇(四)--流程控制ForLoop和WhileLoop

3DMAX assign face map

Chapter 4: talk about class loader again

0 basic learning C language - digital tube

每日一题:力扣:225:用队列实现栈

PVL EDI project case

手写ABA遇到的坑

Daily question 1: force deduction: 225: realize stack with queue
随机推荐
Web APIs DOM 时间对象
自制J-Flash烧录工具——Qt调用jlinkARM.dll方式
Crawler obtains real estate data
Is there any requirement for the value after the case keyword?
剑指offer刷题记录1
China 1,4-cyclohexanedimethanol (CHDM) industry research and investment decision-making report (2022 Edition)
HDR image reconstruction from a single exposure using deep CNN reading notes
Lora sync word settings
Installation and use of labelimg
Const keyword
OpenNMS分离数据库
Clip +json parsing converts the sound in the video into text
Pit encountered by handwritten ABA
uniapp滑动到一定的高度后固定某个元素到顶部效果demo(整理)
MySQL数据库基本操作-DML
RESNET rs: Google takes the lead in tuning RESNET, and its performance comprehensively surpasses efficientnet series | 2021 arXiv
Data storage (1)
Aardio - 不声明直接传float数值的方法
Aardio - construct a multi button component with customplus library +plus
软考高级(信息系统项目管理师)高频考点:项目质量管理