首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >安装"sharp“模块时出错

安装"sharp“模块时出错
EN

Stack Overflow用户
提问于 2020-11-24 21:09:38
回答 2查看 1.6K关注 0票数 0

我已经按照错误所说的做了。我删除了锐化,然后npm install --ignore-scripts=false --verbose,但它仍然不能工作。

我还尝试了:

代码语言:javascript
复制
rimraf node_modules 
rimraf yarn.lock 
yarn

这里的问题可能是什么?

npm: 6.13.4

节点: v10.18.0

python: 3.7.0

夏普:^0.26.2

windows 10专业版64位

代码语言:javascript
复制
!  Error: 
Something went wrong installing the "sharp" module      

\\?\C:\Users\ph2200009\Desktop\TM\cplus_incident_mgnt\functions\node_modules\sharp\build\Release\sharp.node is not a valid Win32 application.
\\?\C:\Users\ph2200009\Desktop\TM\cplus_incident_mgnt\functions\node_modules\sharp\build\Release\sharp.node     

- Remove the "node_modules/sharp" directory then run    
  "npm install --ignore-scripts=false --verbose" and look for errors

at Object.<anonymous> (C:\Users\ph2200009\Desktop\TM\cplus_incident_mgnt\functions\node_modules\sharp\lib\constructor.js:34:9)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)  
    at Object.<anonymous> (C:\Users\ph2200009\Desktop\TM\cplus_incident_mgnt\functions\node_modules\sharp\lib\index.js:3:15)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)  
    at Object.<anonymous> (C:\Users\ph2200009\Desktop\TM\cplus_incident_mgnt\functions\helpers\image.js:1:15)   
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
!  We were unable to load your functions code. (see above)
EN

回答 2

Stack Overflow用户

发布于 2021-02-10 18:48:46

如果您有M1芯片 mac,请按照以下步骤操作,它将帮助您

我用下面的命令解决了我的问题

brew安装vips

npm rebuild --详细锐化

票数 1
EN

Stack Overflow用户

发布于 2020-11-24 21:13:58

尝试删除node_modules文件夹,方法是在终端中键入rm -rf node_modules,然后键入npm i,然后尝试通过npm i sharp再次安装sharp

票数 -1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/64987212

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档