【问题标题】:Something went wrong installing the "sharp" module安装“sharp”模块出了点问题
【发布时间】:2021-03-07 06:39:49
【问题描述】:

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

我也试过了:

rimraf node_modules 
rimraf yarn.lock 
yarn

这里可能有什么问题?

npm:6.13.4

节点:v10.18.0

蟒蛇:3.7.0

尖锐:^0.26.2

Windows 10 专业版 64 位

!  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)

【问题讨论】:

    标签: reactjs npm-install sharp


    【解决方案1】:

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

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

    brew 安装 vips

    npm 重建 --verbose sharp

    【讨论】:

      【解决方案2】:

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

      【讨论】:

      • 我已经这样做了。 rimraf node_modules rimraf yarn.lock yarn 还是不行..
      猜你喜欢
      • 2021-01-21
      • 2022-08-23
      • 2021-08-06
      • 2022-01-21
      • 2021-04-11
      • 2013-02-11
      • 1970-01-01
      • 2022-01-25
      • 2020-01-12
      相关资源
      最近更新 更多