Yarn: Yarn add/Yarn install cannot install fsevents

Created on 13 Jul 2017  Β·  29Comments  Β·  Source: yarnpkg/yarn

Do you want to request a feature or report a bug?
Bug

What is the current behavior?

STR:

When I try to run yarn add jest I get the following error

β‡’  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.

Then, running yarn test (our alias for jest) I get the following error

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.

This is happening on: https://github.com/devtools-html/debugger.html

What is the expected behavior?
Than jest installs and runs.

Please mention your node.js, yarn and operating system version.

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

Most helpful comment

I had to do a combination of multiple proposed solutions:

yarn cache clean && yarn upgrade && yarn

That did the trick. I was attempting to run expo install expo-notifications to install a dependency into an Expo project. I had already deleted node_modules and run yarn install, but for some reason there were still issues. Looks like the cache was the culprit.

All 29 comments

This is not a yarn issue, but an issue with a sub-dependency depending on an old version of fsevents.

Upgrade to v1.1.2, that's the first version with precompiled binaries for node.js 8.
https://github.com/strongloop/fsevents/issues/181

Thanks!

Hmm, but this works in older versions of yarn and with npm..

One more note: this works with yarn 0.24.x

Can't reproduce here, yarn add [email protected] works fine on 0.28.1 / Node 8.1.3

I have yarn 0.27.5 and node 8.1.4 (both the latest you can install from brew). And I also get that 404 when trying to do:

yarn add [email protected]

Running on Mac Os Sierra 10.12.5

I also failed to repro. Tried with empty cache, both with node 6 and node 8.

@hequ @codehag can you try with the latest available yarn?

I created a new empty yarn project with yarn init, cleared the cache with yarn cache clean and then tried installing with yarn add [email protected]. These were run on node 8.1.4 and yarn 0.27.5.

I tried this with yarn 0.28.1 and get the exact same error:

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.

Seems like the tarball is not there:

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.

Well, yeah the file doesn't seem to exist. Not sure if this is Yarn's fault or fsevent's fault or node-gyp's fault.

Ah, yeah. Found corresponding issue from fsevents github page. So the 1.1.1 precompiled version is not on the s3, but 1.1.2 is.

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

Trying to yarn add [email protected] works as expected.

Thanks, @hequ. Closing the issue then. LMK if we need to reopen it.

Hi, I don't think this should be closed.

what works in other versions of yarn
yarn add jest

what does not work in yarn 0.27.5
yarn add jest

Given that this is such an oft-used library I think something is off here..

fsevents may install correctly if you use a specific version, ie 1.1.2, but something changed in yarn to make it stop working even though it worked before.

Also, as mentioned above, yarn add [email protected] works with yarn 0.28 and 0.24-- so something has been fixed / used to work, but what is available now on brew is not installing as expected..

@codehag at least on my machine, I get the 404 error with yarn 0.27.4 as well, so installing [email protected] does not work neither on 0.27.4 or 0.27.5.

@codehag this looks like an issue with fsevents. What is your expectation on Yarn's side to mitigate this?

hm no, i expect that from one version of yarn to the next that things will work :/

I just tried again with 0.24 -- maybe you are right and something changed because it is no longer working. I don't have the time to investigate any further unfortunately. Thanks for your time.

hm no, i expect that from one version of yarn to the next that things will work :/

That's our expectation and aim too! πŸ˜€

I just tried again with 0.24 -- maybe you are right and something changed because it is no longer working. I don't have the time to investigate any further unfortunately. Thanks for your time.

As it happens, yarn and fsevents released new versions close to each other so you are attributing the fault on fsevents' part to Yarn which is understandable. Please give a read to hequ's comment and see if using [email protected] fixes your issue.

Thought I'd chime in on why this is a Yarn issue. It seems that yarn add [email protected] will still attempt to download the 1.1.1 version from S3. A yarn cache clean does not resolve the problem.

Here's an example output.

[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.

When I run yarn list, it looks like fsevents is listed twice, with a fixed version taking precedence.

β”œβ”€ [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

I have no idea why. Chokidar looks correct: https://github.com/paulmillr/chokidar/blob/master/package.json

That's why I believe it to be a Yarn issue with optional deps.

This issue happens when using NPM v8, fixed the issue by switching to NPM V6.10.3.

This started happening again and is still an issue FWIW. Latest output:

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@6 || 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

No amount of rollbacks, reinstalls, rebuilds, and version changes have resolved the issue.

Hi! So I had to install our repo on a new laptop and this is what worked for me.

I've installed yarn using Homebrew
On my laptop I'm running:
node: 9.5.0
yarn: 1.3.2

Tried to run yarn install and got the same error everyone has pasted above. I then deleted the node modules in the repo.

Then ran yarn add fsevents which installed ^1.1.3 directly
Then ran yarn install again seemed to think everything was up to date and all the node modules re-appeared.

Then our project compiled and ran as expected. Obviously not ideal but it worked.

In case you are developing on a Mac but building/running or a linux, adding the 1.1.3 version directly to the optionalDependencies will fix it.

Leaving this here, just in case it can help anyone:
https://github.com/nodejs/node-gyp/issues/809#issuecomment-473261194

If there's no problem in upgrade all, maybe its an old version stuff, try yarn upgrade :)

I ran into this after adding a new workspace - Node: 12.3.1, Yarn: 1.16.0 and Lerna: 3.13.3

Solution for me was yarn cache clean && yarn

I had to do a combination of multiple proposed solutions:

yarn cache clean && yarn upgrade && yarn

That did the trick. I was attempting to run expo install expo-notifications to install a dependency into an Expo project. I had already deleted node_modules and run yarn install, but for some reason there were still issues. Looks like the cache was the culprit.

I downgraded my node version with npm install -g [email protected] and it's working

yarn cache clean && yarn upgrade && yarn

Thank you, @squatto. I just upgraded to the LTS version of Node (10.x -> 12.x) and had this issue (also in an Expo project) but your solution worked for me. πŸ‘

In case if some one gets this error no-xcode-or-clt-version-detected-macos follow this :
https://medium.com/flawless-app-stories/gyp-no-xcode-or-clt-version-detected-macos-catalina-anansewaa-38b536389e8d

Was this page helpful?
0 / 5 - 0 ratings