Yarn: 纱线添加/纱线安装无法安装 fsevents

创建于 2017-07-13  ·  29评论  ·  资料来源: yarnpkg/yarn

您要请求功能还是报告错误
漏洞

目前的行为是什么?

STR:

当我尝试运行yarn add jest ,出现以下错误

⇒  yarn add jest
yarn add v0.27.5
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
[1/1] ⢀ fsevents: 404 status code downloading tarball https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.1.1/fse-v1.1.1-node-v57-darwin-x64.tar.gz
[-/1] ⢀ waiting...
[-/1] ⢀ waiting...
[-/1] ⢀ waiting...
warning Error running install script for optional dependency: "/Users/Ystartsev/Work/temp/debugger.html/node_modules/fsevents: Command failed.\nExit code: 1\nCommand: sh\nArguments: -c node install\nDirectory: /Users/Ystartsev/Work/temp/debugger.html/node_modules/fsevents\nOutput:\nnode-pre-gyp info it worked if it ends with ok\nnode-pre-gyp info using [email protected]\nnode-pre-gyp info using [email protected] | darwin | x64\nnode-pre-gyp info check checked for \"/Users/Ystartsev/Work/temp/debugger.html/node_modules/fsevents/lib/binding/Release/node-v57-darwin-x64/fse.node\" (not found)\nnode-pre-gyp http GET https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.1.1/fse-v1.1.1-node-v57-darwin-x64.tar.gz\nnode-pre-gyp http 404 https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.1.1/fse-v1.1.1-node-v57-darwin-x64.tar.gz\nnode-pre-gyp ERR! Tried to download(404): https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.1.1/fse-v1.1.1-node-v57-darwin-x64.tar.gz \nnode-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v57 ABI) (falling back to source compile with node-gyp) \nnode-pre-gyp http 404 status code downloading tarball https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.1.1/fse-v1.1.1-node-v57-darwin-x64.tar.gz \nnode-pre-gyp ERR! build error \nnode-pre-gyp ERR! stack Error: Failed to execute 'node-gyp clean' (Error: spawn node-gyp ENOENT)\nnode-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/Users/Ystartsev/Work/temp/debugger.html/node_modules/fsevents/node_modules/node-pre-gyp/lib/util/compile.js:77:29)\nnode-pre-gyp ERR! stack     at emitOne (events.js:115:13)\nnode-pre-gyp ERR! stack     at ChildProcess.emit (events.js:210:7)\nnode-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:195:12)\nnode-pre-gyp ERR! stack     at onErrorNT (internal/child_process.js:366:16)\nnode-pre-gyp ERR! stack     at _combinedTickCallback (internal/process/next_tick.js:102:11)\nnode-pre-gyp ERR! stack     at process._tickCallback (internasuccess Saved lockfile.
success Saved 1 new dependency.
└─ [email protected]
Done in 12.29s.

然后,运行纱线测试(我们的玩笑别名)我收到以下错误

yarn test v0.27.5
$ jest
TypeError: projects.map is not a function
    at Object.<anonymous> (/Users/Ystartsev/Work/temp/debugger.html/node_modules/jest-cli/build/cli/runCLI.js:112:28)
    at Generator.next (<anonymous>)
    at step (/Users/Ystartsev/Work/temp/debugger.html/node_modules/jest-cli/build/cli/runCLI.js:1:260)
    at /Users/Ystartsev/Work/temp/debugger.html/node_modules/jest-cli/build/cli/runCLI.js:1:490
    at Promise (<anonymous>)
    at Object.<anonymous> (/Users/Ystartsev/Work/temp/debugger.html/node_modules/jest-cli/build/cli/runCLI.js:1:171)
    at Object.module.exports [as runCLI] (/Users/Ystartsev/Work/temp/debugger.html/node_modules/jest-cli/build/cli/runCLI.js:139:50)
    at Object.run (/Users/Ystartsev/Work/temp/debugger.html/node_modules/devtools-source-map/node_modules/jest-cli/build/cli/index.js:42:17)
    at Object.<anonymous> (/Users/Ystartsev/Work/temp/debugger.html/node_modules/devtools-source-map/node_modules/jest-cli/bin/jest.js:16:25)
    at Module._compile (module.js:569:30)
error Command failed with exit code 1.

这是发生在: https :

什么是预期行为?
比 jest 安装和运行。

请提及您的 node.js、yarn 和操作系统版本。

mac OS Sierra
node version: 8.1.5 (tried on other versions, same issue)
yarn version: 0.27.5
needs-repro-script

最有用的评论

我必须结合多个提议的解决方案:

yarn cache clean && yarn upgrade && yarn

这就是诀窍。 我试图运行expo install expo-notifications将依赖项安装到Expo项目中。 我已经删除了node_modules并运行yarn install ,但由于某种原因仍然存在问题。 看起来缓存是罪魁祸首。

所有29条评论

这不是纱线问题,而是依赖于旧版本 fsevents 的子依赖问题。

升级到 v1.1.2,这是第一个带有 node.js 8 预编译二进制文件的版本。
https://github.com/strongloop/fsevents/issues/181

谢谢!

嗯,但这适用于旧版本的纱线和 npm ..

再注意:这适用于纱线 0.24.x

无法在这里重现, yarn add [email protected]在 0.28.1 / Node 8.1.3 上工作正常

我有 yarn 0.27.5 和 node 8.1.4(两者都是最新的,你可以从brew )。 当我尝试执行以下操作时,我也得到了 404:

yarn add [email protected]

在 Mac Os Sierra 10.12.5 上运行

我也复制失败。 尝试使用空缓存,节点 6 和节点 8。

@hequ @codehag你能试试最新的纱线吗?

我用yarn init创建了一个新的空纱线项目,用yarn cache clean清除缓存,然后尝试用yarn add [email protected] 。 这些在节点 8.1.4 和纱线 0.27.5 上运行。

我用 yarn 0.28.1 尝试了这个并得到完全相同的错误:

hequ @ MacBook-Pro ~/Projects/omat/yarn
└─ $ ▶ yarn add [email protected]
yarn add v0.28.1
info No lockfile found.
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
[4/4] 📃  Building fresh packages...
[1/1] ⠂ fsevents: GET https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.1.1/fse-v1.1.1-node-v57-darwin-x64.tar.gz
[-/1] ⠂ waiting...
[-/1] ⠂ waiting...
[-/1] ⠂ waiting...
error /Users/hequ/Projects/omat/yarn/node_modules/fsevents: Command failed.
Exit code: 1
Command: sh
Arguments: -c node install
Directory: /Users/hequ/Projects/omat/yarn/node_modules/fsevents
Output:
node-pre-gyp info it worked if it ends with ok
node-pre-gyp info using [email protected]
node-pre-gyp info using [email protected] | darwin | x64
node-pre-gyp info check checked for "/Users/hequ/Projects/omat/yarn/node_modules/fsevents/lib/binding/Release/node-v57-darwin-x64/fse.node" (not found)
node-pre-gyp http GET https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.1.1/fse-v1.1.1-node-v57-darwin-x64.tar.gz
node-pre-gyp http 404 https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.1.1/fse-v1.1.1-node-v57-darwin-x64.tar.gz
node-pre-gyp ERR! Tried to download(404): https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.1.1/fse-v1.1.1-node-v57-darwin-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v57 ABI) (falling back to source compile with node-gyp)
node-pre-gyp http 404 status code downloading tarball https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.1.1/fse-v1.1.1-node-v57-darwin-x64.tar.gz
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'node-gyp clean' (Error: spawn node-gyp ENOENT)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/Users/hequ/Projects/omat/yarn/node_modules/fsevents/node_modules/node-pre-gyp/lib/util/compile.js:77:29)
node-pre-gyp ERR! stack     at emitOne (events.js:115:13)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:210:7)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:195:12)
node-pre-gyp ERR! stack     at onErrorNT (internal/child_process.js:366:16)
node-pre-gyp ERR! stack     at _combinedTickCallback (internal/process/next_tick.js:102:11)
node-pre-gyp ERR! stack     at process._tickCallback (internal/process/next_tick.js:161:9)
node-pre-gyp ERR! System Darwin 16.6.0
node-pre-gyp ERR! command "/usr/local/Cellar/node/8.1.4/bin/node" "/Users/hequ/Projects/omat/yarn/node_modules/fsevents/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /Users/hequ/Projects/omat/yarn/node_modules/fsevents
node-pre-gyp ERR! node -v v8.1.4
node-pre-gyp ERR! node-pre-gyp -v v0.6.33
node-pre-gyp ERR! not ok
Failed to execute 'node-gyp clean' (Error: spawn node-gyp ENOENT)
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

似乎 tarball 不存在:

hequ @ MacBook-Pro ~/Projects/omat/yarn
└─ $ ▶ wget https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.1.1/fse-v1.1.1-node-v57-darwin-x64.tar.gz
--2017-07-18 13:21:30--  https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.1.1/fse-v1.1.1-node-v57-darwin-x64.tar.gz
Resolving fsevents-binaries.s3-us-west-2.amazonaws.com... 52.218.192.81
Connecting to fsevents-binaries.s3-us-west-2.amazonaws.com|52.218.192.81|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2017-07-18 13:21:31 ERROR 404: Not Found.

嗯,是的,该文件似乎不存在。 不确定这是 Yarn 的错还是 fsevent 的错或 node-gyp 的错。

啊,是的。 从 fsevents github 页面找到了相应的问题。 所以 1.1.1 预编译版本不在 s3 上,但 1.1.2 是。

https://github.com/strongloop/fsevents/issues/181

尝试yarn add [email protected]可以正常工作。

谢谢,@hequ。 然后关闭问题。 LMK,如果我们需要重新打开它。

你好,我认为这不应该被关闭。

什么在其他版本的纱线中有效
yarn add jest

什么在纱线 0.27.5 中不起作用
yarn add jest

鉴于这是一个如此常用的库,我认为这里有些东西..

如果您使用特定版本,即 1.1.2,fsevents 可能会正确安装,但纱线中的某些更改使其停止工作,即使它以前工作过。

此外,如上所述, yarn add [email protected]与纱线 0.28 和 0.24 一起使用-因此某些内容已修复/用于工作,但是现在 brew 上可用的内容没有按预期安装..

@codehag至少在我的机器上,纱线 0.27.4 也出现 404 错误,因此安装[email protected]在 0.27.4 或 0.27.5 上都不起作用。

@codehag这看起来像是fsevents 。 你对 Yarn 方面的期望是什么来缓解这种情况?

嗯,不,我希望从一个版本的纱线到下一个版本,一切都会奏效:/

我只是用 0.24 再试了一次——也许你是对的,但因为它不再工作,所以发生了一些变化。 不幸的是,我没有时间进一步调查。 谢谢你的时间。

嗯,不,我希望从一个版本的纱线到下一个版本,一切都会奏效:/

这也是我们的期望和目标! 😀

我只是用 0.24 再试了一次——也许你是对的,但因为它不再工作,所以发生了一些变化。 不幸的是,我没有时间进一步调查。 谢谢你的时间。

碰巧的是, yarnfsevents发布了彼此接近的新版本,因此您将fsevents部分的错误归因于 Yarn,这是可以理解的。 请阅读hequ 的评论,看看使用[email protected]解决您的问题。

我想我会解释为什么这是一个 Yarn 问题。 似乎yarn add [email protected]仍会尝试从 S3 下载 1.1.1 版本。 yarn cache clean不能解决问题。

这是一个示例输出。

[18:22:17] Miles:build-tool-config > yarn add [email protected]
yarn add v0.27.5
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
[1/1] ⠂ fsevents: Failed to execute 'node-gyp clean' (Error: spawn node-gyp ENOENT)
[-/1] ⠂ waiting...
[-/1] ⠂ waiting...
[-/1] ⠂ waiting...
warning Error running install script for optional dependency: "/Users/Miles/Sites/build-tool-config/node_modules/rollup-watch/node_modules/fsevents: Command failed.\nExit code: 1\nCommand: sh\nArguments: -c node install\nDirectory: /Users/Miles/Sites/build-tool-config/node_modules/rollup-watch/node_modules/fsevents\nOutput:\nnode-pre-gyp info it worked if it ends with ok\nnode-pre-gyp info using [email protected]\nnode-pre-gyp info using [email protected] | darwin | x64\nnode-pre-gyp info check checked for \"/Users/Miles/Sites/build-tool-config/node_modules/rollup-watch/node_modules/fsevents/lib/binding/Release/node-v57-darwin-x64/fse.node\" (not found)\nnode-pre-gyp http GET https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.1.1/fse-v1.1.1-node-v57-darwin-x64.tar.gz\nnode-pre-gyp http 404 https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.1.1/fse-v1.1.1-node-v57-darwin-x64.tar.gz\nnode-pre-gyp ERR! Tried to download(404): https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.1.1/fse-v1.1.1-node-v57-darwin-x64.tar.gz \nnode-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v57 ABI) (falling back to source compile with node-gyp) \nnode-pre-gyp http 404 status code downloading tarball https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.1.1/fse-v1.1.1-node-v57-darwin-x64.tar.gz \nnode-pre-gyp ERR! build error \nnode-pre-gyp ERR! stack Error: Failed to execute 'node-gyp clean' (Error: spawn node-gyp ENOENT)\nnode-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/Users/Miles/Sites/build-tool-config/node_modules/rollup-watch/node_modules/fsevents/node_modules/node-pre-gyp/lib/util/compile.js:77:29)\nnode-pre-gyp ERR! stack     at emitOne (events.js:115:13)\nnode-pre-gyp ERR! stack     at ChildProcess.emit (events.js:210:7)\nnode-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)\nnode-pre-gyp ERR! stack     at onErrorNT (internal/child_process.js:374:16)\nnode-pre-gyp ERR! stack     at _combinedTickCallback (internal/process/next_tick.js:138:11)\nnode-pre-gyp ERR! stack     at process._tickCallback (internal/process/next_tick.js:180:9)\nnode-pre-gyp ERR! System Darwin 16.6.0\nnode-pre-gyp ERR! command \"/usr/local/Cellar/node/8.2.1/bin/node\" \"/Users/Miles/Sites/build-tool-config/node_modules/rollup-watch/node_modules/fsevents/node_modules/.bin/node-pre-gyp\" \"install\" \"--fallback-to-build\"\nnode-pre-gypsuccess Saved 0 new dependencies.
Done in 11.31s.

当我运行yarn list ,看起来fsevents列出了两次,其中一个固定版本优先。

├─ [email protected]
│  ├─ anymatch@^1.3.0
│  ├─ async-each@^1.0.0
│  ├─ fsevents@^1.0.0
│  ├─ [email protected]
│  │  ├─ nan@^2.3.0
│  │  └─ node-pre-gyp@^0.6.29
│  ├─ glob-parent@^2.0.0
│  ├─ inherits@^2.0.1
│  ├─ is-binary-path@^1.0.0
│  ├─ is-glob@^2.0.0
│  ├─ [email protected]
│  │  ├─ mkdirp@^0.5.1
│  │  ├─ nopt@^4.0.1
│  │  ├─ npmlog@^4.0.2
│  │  ├─ rc@^1.1.7
│  │  ├─ request@^2.81.0
│  │  ├─ rimraf@^2.6.1
│  │  ├─ semver@^5.3.0
│  │  ├─ tar-pack@^3.4.0
│  │  └─ tar@^2.2.1
│  ├─ path-is-absolute@^1.0.0
│  └─ readdirp@^2.0.0

我不知道为什么。 Chokidar 看起来正确: https :

这就是为什么我认为这是可选 deps 的 Yarn 问题。

使用 NPM v8 时会出现此问题,通过切换到 NPM V6.10.3 修复了该问题。

这又开始发生了,仍然是 FWIW 的一个问题。 最新输出:

yarn install v1.3.2
[1/5] 🔍  Validating package.json...
[2/5] 🔍  Resolving packages...
[3/5] 🚚  Fetching packages...
[4/5] 🔗  Linking dependencies...
warning " > [email protected]" has unmet peer dependency "babel-core@^6.0.0 || ^7.0.0-0".
warning " > [email protected]" has unmet peer dependency "babel-core<strong i="6">@6</strong> || 7 || ^7.0.0-alpha || ^7.0.0-beta || ^7.0.0-rc".
[5/5] 📃  Building fresh packages...
[1/5] ⠂ fsevents
[2/5] ⠂ uglifyjs-webpack-plugin
[1/5] ⠄ fsevents
[1/5] ⠈ fsevents: node-pre-gyp http GET https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.1.1/fse-v1.1.1-node-v59-darwin-x64.tar.gz
[-/5] ⠈ waiting...
[3/5] ⠈ fsevents: node-pre-gyp http GET https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.1.3/fse-v1.1.3-node-v59-darwin-x64.tar.gz
[4/5] ⠈ fsevents: node-pre-gyp http GET https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.1.2/fse-v1.1.2-node-v59-darwin-x64.tar.gz
[3/5] ⠁ fsevents: [fsevents] Success: "/Users/Miles/Sites/build-tool-config/node_modules/fsevents/lib/binding/Release/node-v59-darwin-x64/fse
[4/5] ⠁ fsevents: Failed to execute 'node-gyp clean' (Error: spawn node-gyp ENOENT)
warning Error running install script for optional dependency: "/Users/Miles/Sites/build-tool-config/node_modules/sane/node_modules/fsevents: Command failed.\nExit code: 1\nCommand: node install\nArguments: \nDirectory: /Users/Miles/Sites/build-tool-config/node_modules/sane/node_modules/fsevents\nOutput:\nnode-pre-gyp info it worked if it ends with ok\nnode-pre-gyp info using [email protected]\nnode-pre-gyp info using [email protected] | darwin | x64\nnode-pre-gyp info check checked for \"/Users/Miles/Sites/build-tool-config/node_modules/sane/node_modules/fsevents/lib/binding/Release/node-v59-darwin-x64/fse.node\" (not found)\nnode-pre-gyp http GET https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.1.2/fse-v1.1.2-node-v59-darwin-x64.tar.gz\nnode-pre-gyp http 404 https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.1.2/fse-v1.1.2-node-v59-darwin-x64.tar.gz\nnode-pre-gyp ERR! Tried to download(404): https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.1.2/fse-v1.1.2-node-v59-darwin-x64.tar.gz \nnode-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v59 ABI) (falling back to source compile with node-gyp) \nnode-pre-gyp http 404 status code downloading tarball https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.1.2/fse-v1.1.2-node-v59-darwin-x64.tar.gz \nnode-pre-gyp ERR! build error \nnode-pre-gyp ERR! stack Error: Failed to execute 'node-gyp clean' (Error: spawn node-gyp ENOENT)\nnode-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/Users/Miles/Sites/build-tool-config/node_modules/sane/node_modules/node-pre-gyp/lib/util/compile.js:77:29)\nnode-pre-gyp ERR! stack     at ChildProcess.emit (events.js:159:13)\nnode-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:207:12)\nnode-pre-gyp ERR! stack     at onErrorNT (internal/child_process.js:389:16)\nnode-pre-gyp ERR! stack     at process._tickCallback (internal/process/next_tick.js:152:19)\nnode-pre-gyp ERR! System Darwin 17.3.0\nnode-pre-gyp ERR! command \"/usr/local/Cellar/node/9.3.0_1/bin/node\" \"/Users/Miles/Sites/build-tool-config/node_modules/sane/node_modules/fsevents/node_modules/.bin/node-pre-gyp\" \"install\" \"--fallback-to-build\"\nnode-pre-gyp ERR! cwd /Users/Miles/Sites/build-tool-config/node_modules/sane/node_modules/fsevents\nnode-pre-gyp ERR! node -v v9.3.0\nnode-pre-gyp ERR! node-pre-gyp -v v0.6.37\nnode-pre-gyp ERR! not ok \nFailed to execute 'node-gyp clean' (Error: spawn node-gyp ENOENT)"
info This module is OPTIONAL, you can safely ignore this error
warning Error running install script for optional dependency: "/Users/Miles/Sites/build-tool-config/node_modules/watchpack/node_modules/fsevents: Command failed.\nExit code: 1\nCommand: node install\nArguments: \nDirectory: /Users/Miles/Sites/build-tool-config/node_modules/watchpack/node_modules/fsevents\nOutput:\nnode-pre-gyp info it worked if it ends with ok\nnode-pre-gyp info using [email protected]\nnode-pre-gyp info using [email protected] | darwin | x64\nnode-pre-gyp info check checked for \"/Users/Miles/Sites/build-tool-config/node_modules/watchpack/node_modules/fsevents/lib/binding/Release/node-v59-darwin-x64/fse.node\" (not found)\nnode-pre-gyp http GET https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.1.1/fse-v1.1.1-node-v59-darwin-x64.tar.gz\nnode-pre-gyp http 404 https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.1.1/fse-v1.1.1-node-v59-darwin-x64.tar.gz\nnode-pre-gyp ERR! Tried to download(404): https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.1.1/fse-v1.1.1-node-v59-darwin-x64.tar.gz \nnode-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v59 ABI) (falling back to source compile with node-gyp) \nnode-pre-gyp http 404 status code downloading tarball https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.1.1/fse-v1.1.1-node-v59-darwin-x64.tar.gz \nnode-pre-gyp ERR! build error \nnode-pre-gyp ERR! stack Error: Failed to execute 'node-gyp clean' (Error: spawn node-gyp ENOENT)\nnode-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/Users/Miles/Sites/build-tool-config/node_modules/watchpack/node_modules/node-pre-gyp/lib/util/compile.js:77:29)\nnode-pre-gyp ERR! stack     at ChildProcess.emit (events.js:159:13)\nnode-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:207:12)\nnode-pre-gyp ERR! stack     at onErrorNT (internal/child_process.js:389:16)\nnode-pre-gyp ERR! stack     at process._tickCallback (internal/process/next_tick.js:152:19)\nnode-pre-gyp ERR! System Darwin 17.3.0\nnode-pre-gyp ERR! command \"/usr/local/Cellar/node/9.3.0_1/bin/node\" \"/Users/Miles/Sites[-/5] ⠐ waiting...
[-/5] ⠂ waiting...
[-/5] ⠂ waiting...
[-/5] ⠄ waiting...
[-/5] ⠄ waiting...
^C/5] ⠄ weak

没有多少回滚、重新安装、重建和版本更改可以解决问题。

你好! 所以我不得不在一台新笔记本电脑上安装我们的 repo,这对我有用。

我已经使用Homebrew安装了纱线
在我的笔记本电脑上,我正在运行:
node: 9.5.0
yarn: 1.3.2

尝试运行 yarn install 并得到每个人都在上面粘贴的相同错误。 然后我删除了 repo 中的节点模块。

然后运行yarn add fsevents直接安装^1.1.3
然后再次运行yarn install似乎认为一切都是最新的并且所有节点模块重新出现。

然后我们的项目按预期编译并运行。 显然不理想,但它奏效了。

如果您在 Mac 上开发但正在构建/运行或 linux,将 1.1.3 版本直接添加到optionalDependencies将修复它。

把这个留在这里,以防万一它可以帮助任何人:
https://github.com/nodejs/node-gyp/issues/809#issuecomment -473261194

如果全部升级没有问题,可能是旧版本的东西,请尝试yarn upgrade :)

我在添加新工作区后遇到了这个问题 - 节点:12.3.1,纱线:1.16.0 和 Lerna:3.13.3

我的解决方案是yarn cache clean && yarn

我必须结合多个提议的解决方案:

yarn cache clean && yarn upgrade && yarn

这就是诀窍。 我试图运行expo install expo-notifications将依赖项安装到Expo项目中。 我已经删除了node_modules并运行yarn install ,但由于某种原因仍然存在问题。 看起来缓存是罪魁祸首。

我用npm install -g [email protected]降级了我的节点版本并且它正在工作

纱线缓存清洁 && 纱线升级 && 纱线

谢谢你,@squatto。 我刚刚升级到 LTS 版本的 Node (10.x -> 12.x) 并遇到了这个问题(也在 Expo 项目中),但您的解决方案对我有用。 👍

如果有人收到此错误no-xcode-or-clt-version-detected-macos按照以下步骤操作:
https://medium.com/flawless-app-stories/gyp-no-xcode-or-clt-version-detected-macos-catalina-anansewaa-38b536389e8d

此页面是否有帮助?
0 / 5 - 0 等级