yarnpkg / yarn

The 1.x line is frozen - features and bugfixes now happen on https://github.com/yarnpkg/berry
https://classic.yarnpkg.com
Other
41.44k stars 2.72k forks source link

Yarn >= 1.0.0 fsevents blocks installing other packages on linux (maybe windows) #4957

Open aikar opened 6 years ago

aikar commented 6 years ago

Bug Report: Starting with Yarn 1.0.0 and all versions since (issue does not occur on 0.27), if a package depends on fsevents, other packages such as node-sass that includes npmlog and maybe other packages has issues.

I believe the issue is that when an optional package like fsevents fails, yarn is removing the packages related to it, even if something else needs them. Reproduce steps:

mkdir test && cd test && npm init -y && yarn add fsevents -O --ignore-platform && yarn add node-sass

I guess the yarn add fsevents is a bug in itself -- platform checks shouldnt be ran on add, as what if I was developing something and needed fsevents for mac? I had to add --ignore-platform just to get it to add.

But that's not the bug i'm reporting.

In this command, node-sass will fail to add due to missing modules. In this case I'm getting missing brace expansion

In my other project where I discovered this, I'm getting missing are-we-there-yet.

if I remove node-sass from my project, and run yarn install. are-we-there-yet appears in node_modules (from other stuff, in this case node-pre-gyp)

but soon as I yarn add node-sass, I get error about are-we-there-yet missing, and the folder has been deleted from node_modules.

rafayepes commented 6 years ago

In our case I can install dependencies correctly but a colleague can only install dependencies with npm now. These are the versions on his machine and the installation logs.

Looks like similar issue was reported in the past in #3926

$ node -v
v8.7.0
$ npm -v
5.5.1
$ yarn -v
1.3.2
anonymous@Lexa:~/Project$ yarn
yarn install v1.3.2
$ ../utils/npm/preinstall.sh
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
warning Pattern ["esprima-fb@~3001.0001.0000-dev-harmony-fb"] is trying to unpack in the same destination "/Users/anonymous/Library/Caches/Yarn/v1/npm-esprima-fb-3001.1.0-dev-harmony-fb-b77d37abcd38ea0b77426bb8bc2922ce6b426411" as pattern ["esprima-fb@~3001.1.0-dev-harmony-fb"]. This could result in a non deterministic behavior, skipping.
[3/4] 🔗  Linking dependencies...
warning " > babel-preset-es2015-loose@8.0.0" has unmet peer dependency "babel-preset-es2015@*".
warning "webpack > ajv-keywords@1.5.1" has unmet peer dependency "ajv@>=4.10.0".
warning " > grunt-todos@0.3.0" has incorrect peer dependency "grunt@~0.4.0".
warning " > url-loader@0.5.7" has unmet peer dependency "file-loader@*".
[4/4] 📃  Building fresh packages...
[-/7] ⠁ waiting...
[2/7] ⠁ fsevents: No receipt for 'com.apple.pkg.CLTools_Executables' found at '/'.
[6/7] ⠁ ngrok: ngrok - downloading binary https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-darwin-amd64.zip ...
[7/7] ⠁ node-sass: Downloading binary from https://github.com/sass/node-sass/releases/download/v4.5.3/darwin-x64-57_binding.node
warning Error running install script for optional dependency: "/Users/anonymous/Project/node_modules/fsevents: Command failed.\nExit code: 1\nCommand: node install\nArguments: \nDirectory: /Users/anonymous/Project/node_modules/fsevents\nOutput:\nnode-pre-gyp info it worked if it ends with ok\nnode-pre-gyp info using node-pre-gyp@0.6.33\nnode-pre-gyp info using node@8.7.0 | darwin | x64\nnode-pre-gyp info check checked for \"/Users/anonymous/Project/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 fsevents@1.1.1 and node@8.7.0 (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 \ngyp info it worked if it ends with ok\ngyp info using node-gyp@3.4.0\ngyp info using node@8.7.0 | darwin | x64\ngyp info ok \ngyp info it worked if it ends with ok\ngyp info using node-gyp@3.4.0\ngyp info using node@8.7.0 | darwin | x64\ngyp info spawn /Library/Frameworks/Python.framework/Versions/2.7/bin/python2\ngyp info spawn args [ '/Users/anonymous/Project/node_modules/node-gyp/gyp/gyp_main.py',\ngyp info spawn args   'binding.gyp',\ngyp info spawn args   '-f',\ngyp info spawn args   'make',\ngyp info spawn args   '-I',\ngyp info spawn args   '/Users/anonymous/Project/node_modules/fsevents/build/config.gypi',\ngyp info spawn args   '-I',\ngyp info spawn args   '/Users/anonymous/Project/node_modules/node-gyp/addon.gypi',\ngyp info spawn args   '-I',\ngyp info spawn args   '/Users/anonymous/.node-gyp/8.7.0/include/node/common.gypi',\ngyp info spawn args   '-Dlibrary=shared_library',\ngyp info spawn args   '-Dvisibility=default',\ngyp info spawn args   '-Dnode_root_dir=/Users/anonymous/.node-gyp/8.7.0',\ngyp info spawn args   '-Dnode_gyp_dir=/Users/anonymous/Project/node_modules/node-gyp',\ngyp info spawn args   '-Dnode_lib_file=node.lib',\ngyp info spawn args   '-Dmodule_root_dir=/Users/anonymous/Project/node_modules/fsevents',\ngyp info spawn args   '--depth=.',\ngyp info spawn args   '--no-parallel',\ngyp info spawn args   '--generator-output',\ngyp info spawn args   'build',\ngyp info spawn args   '-Goutput_dir=.' ]\nxcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance\n\nxcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance\n\nNo receipt for 'com.apple.pkg.CLTools_Executables' found at '/'.\n\nNo receipt for 'com.apple.pkg.DeveloperToolsCLILeo' found at '/'.\n\nNo receipt for 'com.apple.pkg.DeveloperToolsCLI' found at '/'.\n\ngyp: No Xcode or CLT version detected!\ngyp ERR! configure error \ngyp ERR! stack Error: `gyp` failed with exit code: 1\ngyp ERR! stack     at ChildProcess.onCpExit (/Users/anonymous/Project/node_modules/node-gyp/lib/configure.js:305:16)\ngyp ERR! stack     at emitTwo (events.js:125:13)\ngyp ERR! stack     at ChildProcess.emit (events.js:213:7)\ngyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)\ngyp ERR! System Darwin 17.2.0\ngyp ERR! command \"/Users/anonymous/n/bin/node\" \"/Users/anonymous/Project/node_modules/node-gyp/bin/node-gyp.js\" \"configure\" \"--fallback-to-build\" \"--module=/Users/anonymous/Project/node_modules/fsevents/lib/binding/Release/node-v57-darwin-x64/fse.node\" \"--module_name=fse\" \"--module_path=/Users/anonymous/Project/node_modules/fsevents/lib/binding/Release/node-v57-darwin-x64\"\ngyp ERR! cwd /Users/anonymous/Project/node_modules/fsevents\ngyp ERR! node -v v8.7.0\ngyp ERR! node-gyp -v v3.4.0\ngyp ERR! not ok \nnode-pre-gyp ERR! build error \nnode-pre-gyp ERR! stack Error: Failed to execute '/Users/anonymous/n/bin/node /Users/anonymous/Project/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/Users/anonymous/Project/node_modules/fsevents/lib/binding/Release/node-v57-darwin-x64/fse.node --module_name=fse --module_path=/Users/anonymous/Project/node_modules/fsevents/lib/binding/Release/node-v57-darwin-x64' (1)\nnode-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/Users/anonymous/Project/node_modules/node-pre-gyp/lib/util/compile.js:83:29)\nnode-pre-gyp ERR! stack     at emitTwo (events.js:125:13)\nnode-pre-gyp ERR! stack     at ChildProcess.emit (events.js:213:7)\nnode-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:927:16)\nnode-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)\nnode-pre-gyp ERR! System Darwin 17.2.0\nnode-pre-gyp ERR! command \"/Users/anonymous/n/bin/node\" \"/Users/anonymous/Project/node_modules/fsevents/node_modules/.bin/node-pre-gyp\" \"install\" \"--fallback-to-build\"\nnode-pre-gyp ERR! cwd /Users/anonymous/Project/node_modules/fsevents\nnode-pre-gyp ERR! node -v v8.7.0\nnode-pre-gyp ERR! node-pre-gyp -v v0.6.33\nnode-pre-gyp ERR! not ok \nFailed to execute '/User$ ../utils/npm/postinstall.sh
NPM PostInstall: Updating githooks and fixing eslint cache
Git hooks updated
✨  Done in 19.15s.
anonymous@Lexa:~/Project$ yarn add -D fsevents@1.1.2
yarn add v1.3.2
$ ../utils/npm/preinstall.sh
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
warning Pattern ["esprima-fb@~3001.0001.0000-dev-harmony-fb"] is trying to unpack in the same destination "/Users/anonymous/Library/Caches/Yarn/v1/npm-esprima-fb-3001.1.0-dev-harmony-fb-b77d37abcd38ea0b77426bb8bc2922ce6b426411" as pattern ["esprima-fb@~3001.1.0-dev-harmony-fb"]. This could result in a non deterministic behavior, skipping.
[3/4] 🔗  Linking dependencies...
warning " > babel-preset-es2015-loose@8.0.0" has unmet peer dependency "babel-preset-es2015@*".
warning "webpack > ajv-keywords@1.5.1" has unmet peer dependency "ajv@>=4.10.0".
warning " > grunt-todos@0.3.0" has incorrect peer dependency "grunt@~0.4.0".
warning " > url-loader@0.5.7" has unmet peer dependency "file-loader@*".
[4/4] 📃  Building fresh packages...
[1/3] ⡀ fsevents: No receipt for 'com.apple.pkg.DeveloperToolsCLILeo' found at '/'.
[-/3] ⡀ waiting...
[3/3] ⡀ ngrok: ngrok - downloading binary https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-darwin-amd64.zip ...
[-/3] ⡀ waiting...
warning Error running install script for optional dependency: "/Users/anonymous/Project/node_modules/dustjs-linkedin/node_modules/fsevents: Command failed.\nExit code: 1\nCommand: node install\nArguments: \nDirectory: /Users/anonymous/Project/node_modules/dustjs-linkedin/node_modules/fsevents\nOutput:\nnode-pre-gyp info it worked if it ends with ok\nnode-pre-gyp info using node-pre-gyp@0.6.33\nnode-pre-gyp info using node@8.7.0 | darwin | x64\nnode-pre-gyp info check checked for \"/Users/anonymous/Project/node_modules/dustjs-linkedin/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 fsevents@1.1.1 and node@8.7.0 (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 \ngyp info it worked if it ends with ok\ngyp info using node-gyp@3.4.0\ngyp info using node@8.7.0 | darwin | x64\ngyp info ok \ngyp info it worked if it ends with ok\ngyp info using node-gyp@3.4.0\ngyp info using node@8.7.0 | darwin | x64\ngyp info spawn /Library/Frameworks/Python.framework/Versions/2.7/bin/python2\ngyp info spawn args [ '/Users/anonymous/Project/node_modules/node-gyp/gyp/gyp_main.py',\ngyp info spawn args   'binding.gyp',\ngyp info spawn args   '-f',\ngyp info spawn args   'make',\ngyp info spawn args   '-I',\ngyp info spawn args   '/Users/anonymous/Project/node_modules/dustjs-linkedin/node_modules/fsevents/build/config.gypi',\ngyp info spawn args   '-I',\ngyp info spawn args   '/Users/anonymous/Project/node_modules/node-gyp/addon.gypi',\ngyp info spawn args   '-I',\ngyp info spawn args   '/Users/anonymous/.node-gyp/8.7.0/include/node/common.gypi',\ngyp info spawn args   '-Dlibrary=shared_library',\ngyp info spawn args   '-Dvisibility=default',\ngyp info spawn args   '-Dnode_root_dir=/Users/anonymous/.node-gyp/8.7.0',\ngyp info spawn args   '-Dnode_gyp_dir=/Users/anonymous/Project/node_modules/node-gyp',\ngyp info spawn args   '-Dnode_lib_file=node.lib',\ngyp info spawn args   '-Dmodule_root_dir=/Users/anonymous/Project/node_modules/dustjs-linkedin/node_modules/fsevents',\ngyp info spawn args   '--depth=.',\ngyp info spawn args   '--no-parallel',\ngyp info spawn args   '--generator-output',\ngyp info spawn args   'build',\ngyp info spawn args   '-Goutput_dir=.' ]\nxcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance\n\nxcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance\n\nNo receipt for 'com.apple.pkg.CLTools_Executables' found at '/'.\n\nNo receipt for 'com.apple.pkg.DeveloperToolsCLILeo' found at '/'.\n\nNo receipt for 'com.apple.pkg.DeveloperToolsCLI' found at '/'.\n\ngyp: No Xcode or CLT version detected!\ngyp ERR! configure error \ngyp ERR! stack Error: `gyp` failed with exit code: 1\ngyp ERR! stack     at ChildProcess.onCpExit (/Users/anonymous/Project/node_modules/node-gyp/lib/configure.js:305:16)\ngyp ERR! stack     at emitTwo (events.js:125:13)\ngyp ERR! stack     at ChildProcess.emit (events.js:213:7)\ngyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)\ngyp ERR! System Darwin 17.2.0\ngyp ERR! command \"/Users/anonymous/n/bin/node\" \"/Users/anonymous/Project/node_modules/node-gyp/bin/node-gyp.js\" \"configure\" \"--fallback-to-build\" \"--module=/Users/anonymous/Project/node_modules/dustjs-linkedin/node_modules/fsevents/lib/binding/Release/node-v57-darwin-x64/fse.node\" \"--module_name=fse\" \"--module_path=/Users/anonymous/Project/node_modules/dustjs-linkedin/node_modules/fsevents/lib/binding/Release/node-v57-darwin-x64\"\ngyp ERR! cwd /Users/anonymous/Project/node_modules/dustjs-linkedin/node_modules/fsevents\ngyp ERR! node -v v8.7.0\ngyp ERR! node-gyp -v v3.4.0\ngyp ERR! not ok \nnode-pre-gyp ERR! build error \nnode-pre-gyp ERR! stack Error: Failed to execute '/Users/anonymous/n/bin/node /Users/anonymous/Project/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/Users/anonymous/Project/node_modules/dustjs-linkedin/node_modules/fsevents/lib/binding/Release/node-v57-darwin-x64/fse.node --module_name=fse --module_path=/Users/anonymous/Project/node_modules/dustjs-linkedin/node_modules/fsevents/lib/binding/Release/node-v57-darwin-x64' (1)\nnode-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/Users/anonymous/Project/node_modules/dustjs-linkedin/node_modules/node-pre-gyp/lib/util/compile.js:83:29)\nnode-pre-gyp ERR! stack     at emitTwo (events.js:125:13)\nnode-pre-gyp ERR! stack     at ChildProcess.emit (events.js:213:7)\nnode-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:927:16)\nnode-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)\nnode-pre-gyp ERR! System Darwin 17.2.0\nnode-pre-gyp ERR! command \"/Users/anonymous/n/bin/node\" \"/Users/anonymous/Project/node_modules/dustjs-linkedin/node_modules/fsevents/node_modules/.bin/node-pre-gyp\" \"install\" \"--fallback-to-build\"\nnode-pre-gyp ERR! cwd /Users/anonymous/Project/node_modules/dusuccess Saved lockfile.
success Saved 0 new dependencies.
$ ../utils/npm/postinstall.sh
NPM PostInstall: Updating githooks and fixing eslint cache
Git hooks updated
✨  Done in 14.53s.
aikar commented 6 years ago

@rafayepes that is an unrelated issue. You need to accept xcode agreement