问题

C:\Users\Administrator\AppData\Roaming\npm\node_modules\sharp\lib\sharp.js:30
  throw new Error(help.join('\n'));
  ^

Error:
Something went wrong installing the "sharp" module

The specified procedure could not be found.
\?\C:\Users\Administrator\AppData\Roaming\npm\node_modules\sharp\build\Release\sharp-win32-x64.node

Possible solutions:
- Install with the --verbose flag and look for errors: "npm install --ignore-scripts=false --verbose sharp"
- Install for the current runtime: "npm install --platform=win32 --arch=x64 sharp"
- Consult the installation documentation: https://sharp.pixelplumbing.com/install
    at Object.<anonymous> (C:\Users\Administrator\AppData\Roaming\npm\node_modules\[4msharp[24m\lib\sharp.js:30:9)
[90m    at Module._compile (node:internal/modules/cjs/loader:1101:14)[39m
[90m    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)[39m
[90m    at Module.load (node:internal/modules/cjs/loader:981:32)[39m
[90m    at Function.Module._load (node:internal/modules/cjs/loader:822:12)[39m
[90m    at Module.require (node:internal/modules/cjs/loader:1005:19)[39m
[90m    at require (node:internal/modules/cjs/helpers:102:18)[39m
    at Object.<anonymous> (C:\Users\Administrator\AppData\Roaming\npm\node_modules\[4msharp[24m\lib\constructor.js:8:1)
[90m    at Module._compile (node:internal/modules/cjs/loader:1101:14)[39m
[90m    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)[39m
npm sharp 执行报错
on it road .com

解决方案

检查出现问题前后是否安装了新的npm包。常见原因是因为安装了canvas

卸载它后,问题解决:

npm uninstall canvas -g
npm uninstall canvas
日期:2020-09-17 00:16:23 来源:oir作者:oir