为什么会这样?谁可以给我答案

时间:2019-05-01 09:46:10

标签: npm-install

安装问题

PS C:\ Users \ Administrator> gatsby新的gatsby-site3 信息从git创建新站点:https://github.com/gatsbyjs/gatsby-starter-default.git 克隆到“ gatsby-site3” ... 远程:枚举对象:54,完成。 远程:计数对象:100%(54/54),已完成。 远程:压缩对象:100%(34/34),已完成。 远程:总计1578(增量39),已重用35(增量20),已重复使用包装1524 接收物体:100%(1578/1578),5.71 MiB | 149.00 KiB / s,已完成。 解析增量:100%(954/954),已完成。 成功创建启动程序目录布局 信息正在安装软件包...

  

sharp@0.21.3安装C:\ Users \ Administrator \ gatsby-site3 \ node_modules \ sharp   (节点安装/ libvips和&节点安装/ dll复制和&预构建安装)|| (node-gyp重建&&节点安装/ dll复制)

信息犀利使用缓存的C:\ Users \ Administrator \ AppData \ Roaming \ npm-cache_libvips \ libvips-8.7.0-win32-x64.tar.gz 信息锐利创建C:\ Users \ Administrator \ gatsby-site3 \ node_modules \ sharp \ build \ Release 信息锐利从C:\ Users \ Administrator \ gatsby-site3 \ node_modules \ sharp \ vendor \ lib复制DLL到C:\ Users \ Administrator \ gatsby-site3 \ node_modules \ sharp \ build \ Release prebuild-install WARN安装未找到预构建的二进制文件(target = 12.1.0 runtime = node arch = x64 libc = platform = win32)

C:\ Users \ Administrator \ gatsby-site3 \ node_modules \ sharp>如果未定义npm_config_node_gyp(节点“ C:\ Program Files \ nodejs \ node_modules \ npm \ node_modules \ npm-lifecycle \ node-gyp-bin \”。 ... \ node_modules \ node-gyp \ bin \ node-gyp.js“ rebuild)else(节点” C:\ Program Files \ nodejs \ node_modules \ npm \ node_modules \ node-gyp \ bin \ node-gyp.js“重建) 追溯(最近一次通话):   文件“ C:\ Program Files \ nodejs \ node_modules \ npm \ node_modules \ node-gyp \ gyp \ gyp_main.py”,第13行,在     进口石膏   文件“ C:\ Program Files \ nodejs \ node_modules \ npm \ node_modules \ node-gyp \ gyp \ pylib \ gyp__init __。py”,第7行,在     导入副本   文件“ C:\ Python27 \ lib \ copy.py”,第52行,在     导入弱引用   文件“ C:\ Python27 \ lib \ weakref.py”,第14行,在     从_weakref导入( ImportError:无法导入名称_remove_dead_weakref 糟糕!配置错误 糟糕!堆栈错误:gyp失败,退出代码:1 糟糕!堆栈在ChildProcess.onCpExit(C:\ Program Files \ nodejs \ node_modules \ npm \ node_modules \ node-gyp \ lib \ configure.js:345:16) 糟糕!堆栈在ChildProcess.emit(events.js:196:13) 糟糕!堆栈位于Process.ChildProcess._handle.onexit(internal / child_process.js:256:12) 糟糕!系统Windows_NT 10.0.17134 糟糕!命令“ C:\ Program Files \ nodejs \ node.exe”“ C:\ Program Files \ nodejs \ node_modules \ npm \ node_modules \ node-gyp \ bin \ node-gyp.js”“重建” 糟糕! CWD C:\ Users \ Administrator \ gatsby-site3 \ node_modules \ sharp 糟糕!节点-v v12.1.0 糟糕!节点gyp -v v3.8.0 糟糕!不好 npm警告可选的跳过可选依赖性:fsevents@1.2.9(node_modules \ fsevents): npm WARN notsup跳过依赖项:fsevents@1.2.9不受支持的平台:通缉{“ os”:“ darwin”,“ arch”:“ any”}(当前:{“ os”:“ win32”,“ arch”: “ x64”})

npm错误!代码ELIFECYCLE npm ERR! errno 1 npm ERR! sharp@0.21.3安装:(node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy) npm ERR!退出状态1 npm ERR! npm ERR!在Sharp@0.21.3安装脚本上失败。 npm ERR! npm可能不是问题。上面可能还有其他日志记录输出。

npm错误!可以在以下位置找到此运行的完整日志: npm ERR! C:\ Users \ Administrator \ AppData \ Roaming \ npm-cache_logs \ 2019-05-01T09_34_10_497Z-debug.log 错误命令失败:npm install

错误:命令失败:npm install

  • index.js:236 [npm] / [gatsby-cli] / [execa] /index.js:236:11

  • task_queues.js:89 processTicksAndRejections 内部/进程/task_queues.js:89:5

1 个答案:

答案 0 :(得分:0)

Gatsby软件包当前使用的是sharp的较早版本。当Gatsby开发人员升级其依赖性并发布依赖于最新版本的新版本时,这将自行解决。

我建议三个选项:

  1. 至少降级到节点11(我建议研究Node Version Manager
  2. 如果您使用的是yarn,请在package.json中的yarn中使用分辨率功能:
{
  "resolutions": {
    "sharp": "0.22.1"
  }
}
  1. 等待依赖于最新版本的新版本
相关问题