当前位置:网站首页>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
边栏推荐
- How big is the empty structure?
- Attack and defense world miscall
- Netxpert xg2 helps you solve the problem of "Cabling installation and maintenance"
- The SQL response is slow. What are your troubleshooting ideas?
- CocosCreator+TypeScripts自己写一个对象池
- LeetCode 练习——剑指 Offer 26. 树的子结构
- case 关键字后面的值有什么要求吗?
- Anaconda installs third-party packages
- 2022-07-04 the high-performance database engine stonedb of MySQL is compiled and run in centos7.9
- BasicVSR_PlusPlus-master测试视频、图片
猜你喜欢
Crawler obtains real estate data
Web APIs DOM time object
手写ABA遇到的坑
Netxpert xg2 helps you solve the problem of "Cabling installation and maintenance"
Config:invalid signature solution and troubleshooting details
Self made j-flash burning tool -- QT calls jlinkarm DLL mode
That's why you can't understand recursion
Mise en place d'un environnement de développement OP - tee basé sur qemuv8
Daily question 1: force deduction: 225: realize stack with queue
Memorabilia of domestic database in June 2022 - ink Sky Wheel
随机推荐
SQL server generates auto increment sequence number
const关键字
CocosCreator+TypeScripts自己写一个对象池
How big is the empty structure?
Clip +json parsing converts the sound in the video into text
MySQL教程的天花板,收藏好,慢慢看
Aardio - 利用customPlus库+plus构造一个多按钮组件
config:invalid signature 解决办法和问题排查详解
项目复盘模板
Aardio - 封装库时批量处理属性与回调函数的方法
Report on technological progress and development prospects of solid oxide fuel cells in China (2022 Edition)
Void keyword
uniapp滑动到一定的高度后固定某个元素到顶部效果demo(整理)
2022-07-04 mysql的高性能数据库引擎stonedb在centos7.9编译及运行
2022-07-05 stonedb sub query processing parsing time analysis
Aardio - 不声明直接传float数值的方法
雅思口语的具体步骤和时间安排是什么样的?
2022-07-04 the high-performance database engine stonedb of MySQL is compiled and run in centos7.9
自制J-Flash烧录工具——Qt调用jlinkARM.dll方式
2022-07-05 使用tpcc对stonedb进行子查询测试