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.37k stars 2.72k forks source link

Yarn Install Fails on Linking dependencies: error An unexpected error occurred: "_iterator3[Symbol.iterator] is not a function". #8929

Open bnheise opened 1 year ago

bnheise commented 1 year ago

This happens with yarn, but not with npm. Please let me know if you need any more details than this to solve the issue.

Arguments: 
  /Users/brianheise/liferay/demos/ce-cli/build/node/bin/node /Users/brianheise/liferay/demos/ce-cli/build/node/lib/node_modules/yarn/yarn-1.13.0.js --production false install --ignore-engines

PATH: 
  /Users/brianheise/liferay/demos/ce-cli/build/node/bin:/Users/brianheise/.jenv/versions/11.0.12/bin:/usr/local/Cellar/jenv/0.5.6/libexec/libexec:/Users/brianheise/bin:/Users/brianheise/.sdkman/candidates/groovy/current/bin:/Users/brianheise/Library/pnpm:/Users/brianheise/.nvm/versions/node/v18.14.2/bin:/Users/brianheise/.jenv/shims:/Users/brianheise/.pyenv/bin:./bin:./node_modules/.bin:/Users/brianheise/.rbenv/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/Library/Frameworks/Python.framework/Versions/3.10/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/share/dotnet:~/.dotnet/tools:/Library/Apple/usr/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Users/brianheise/.cargo/bin:/Users/brianheise/Library/PackageManager/bin:/usr/local/sbin:/Users/brianheise/Gradle/bin:/Users/brianheise/Android/cmdline-tools/tools:/Users/brianheise/Android/cmdline-tools/tools/bin:/Users/brianheise/Android/cmdline-tools/platform-tools:/Library/Java/JavaVirtualMachines/jdk-11.0.12.jdk/Contents/Home//bin:/Users/brianheise/liferay/repos/git-tools:/Users/brianheise/Library/PackageManager/bin:/Users/brianheise/.jenv/bin:/opt/apache-maven/bin:/Users/brianheise/Library/PackageManager/bin:/Users/brianheise/liferay/repos/liferay_ie_tool/target/debug:/bin:/usr/local/bin

Yarn version: 
  1.13.0

Node version: 
  16.13.0

Platform: 
  darwin x64

Trace: 
  TypeError: _iterator3[Symbol.iterator] is not a function
      at /Users/brianheise/liferay/demos/ce-cli/build/node/lib/node_modules/yarn/yarn-1.13.0.js:48406:168
      at Generator.next (<anonymous>)
      at step (/Users/brianheise/liferay/demos/ce-cli/build/node/lib/node_modules/yarn/yarn-1.13.0.js:310:30)
      at /Users/brianheise/liferay/demos/ce-cli/build/node/lib/node_modules/yarn/yarn-1.13.0.js:328:14
      at new Promise (<anonymous>)
      at new F (/Users/brianheise/liferay/demos/ce-cli/build/node/lib/node_modules/yarn/yarn-1.13.0.js:25582:28)
      at /Users/brianheise/liferay/demos/ce-cli/build/node/lib/node_modules/yarn/yarn-1.13.0.js:307:12
      at PackageLinker.linkBinDependencies (/Users/brianheise/liferay/demos/ce-cli/build/node/lib/node_modules/yarn/yarn-1.13.0.js:48468:7)
      at /Users/brianheise/liferay/demos/ce-cli/build/node/lib/node_modules/yarn/yarn-1.13.0.js:49002:28
      at Generator.next (<anonymous>)

npm manifest: 
  {
      "private": true,
      "workspaces": {
          "packages": [
              "client-extensions/vue-init-test"
          ]
      },
      "dependencies": {
          "ce-cli": "^0.1.0"
      }
  }

yarn manifest: 
  No manifest

Lockfile: 
  No lockfile
Arguments: 
  /Users/brianheise/liferay/demos/ce-cli/build/node/bin/node /Users/brianheise/liferay/demos/ce-cli/build/node/lib/node_modules/yarn/yarn-1.13.0.js --production false install --ignore-engines

PATH: 
  /Users/brianheise/liferay/demos/ce-cli/build/node/bin:/Users/brianheise/.jenv/versions/11.0.12/bin:/usr/local/Cellar/jenv/0.5.6/libexec/libexec:/Users/brianheise/bin:/Users/brianheise/.sdkman/candidates/groovy/current/bin:/Users/brianheise/Library/pnpm:/Users/brianheise/.nvm/versions/node/v18.14.2/bin:/Users/brianheise/.jenv/shims:/Users/brianheise/.pyenv/bin:./bin:./node_modules/.bin:/Users/brianheise/.rbenv/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/Library/Frameworks/Python.framework/Versions/3.10/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/share/dotnet:~/.dotnet/tools:/Library/Apple/usr/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Users/brianheise/.cargo/bin:/Users/brianheise/Library/PackageManager/bin:/usr/local/sbin:/Users/brianheise/Gradle/bin:/Users/brianheise/Android/cmdline-tools/tools:/Users/brianheise/Android/cmdline-tools/tools/bin:/Users/brianheise/Android/cmdline-tools/platform-tools:/Library/Java/JavaVirtualMachines/jdk-11.0.12.jdk/Contents/Home//bin:/Users/brianheise/liferay/repos/git-tools:/Users/brianheise/Library/PackageManager/bin:/Users/brianheise/.jenv/bin:/opt/apache-maven/bin:/Users/brianheise/Library/PackageManager/bin:/Users/brianheise/liferay/repos/liferay_ie_tool/target/debug:/bin:/usr/local/bin

Yarn version: 
  1.13.0

Node version: 
  16.13.0

Platform: 
  darwin x64

Trace: 
  TypeError: _iterator3[Symbol.iterator] is not a function
      at /Users/brianheise/liferay/demos/ce-cli/build/node/lib/node_modules/yarn/yarn-1.13.0.js:48406:168
      at Generator.next (<anonymous>)
      at step (/Users/brianheise/liferay/demos/ce-cli/build/node/lib/node_modules/yarn/yarn-1.13.0.js:310:30)
      at /Users/brianheise/liferay/demos/ce-cli/build/node/lib/node_modules/yarn/yarn-1.13.0.js:328:14
      at new Promise (<anonymous>)
      at new F (/Users/brianheise/liferay/demos/ce-cli/build/node/lib/node_modules/yarn/yarn-1.13.0.js:25582:28)
      at /Users/brianheise/liferay/demos/ce-cli/build/node/lib/node_modules/yarn/yarn-1.13.0.js:307:12
      at PackageLinker.linkBinDependencies (/Users/brianheise/liferay/demos/ce-cli/build/node/lib/node_modules/yarn/yarn-1.13.0.js:48468:7)
      at /Users/brianheise/liferay/demos/ce-cli/build/node/lib/node_modules/yarn/yarn-1.13.0.js:49002:28
      at Generator.next (<anonymous>)

npm manifest: 
  {
      "private": true,
      "workspaces": {
          "packages": [
              "client-extensions/vue-init-test"
          ]
      },
      "dependencies": {
          "ce-cli": "^0.1.0"
      }
  }

yarn manifest: 
  No manifest

Lockfile: 
  No lockfile
avmaxim commented 1 year ago

@bnheise Hi! Firstly, I hope its just an example Yarn command usage. As If I got your idea correctly, a valid command execution has to look like this:

yarn install --production=false --ignore-engines // Note the order: yarn [command] [flags]

Secondly, I'd recommend narrowing down the issue: try to remove ce-cli dependency from your project and see if the issue still persists. I suspect it won't. I've done the following steps in a sandbox:

  1. Create a separate folder
  2. Run npm init
  3. Add a different dependency or leave a Dependencies object empty
  4. Run yarn install --production=false --ignore-engines OR simply yarn install

This works fine for me for any dependency:

image

What leads to the conclusion that there's something special with the ce-cli package, since it also fails for me when I add this as a dependency.

This library does not seem to have package.json and it seems to use Cargo as Rust Package Manager. As of now Yarn is very focused primarily on Javascript. And you're trying to intermingle it. So I do not consider it a bug since it's not supported so far. This seems to be a feature to support Rust.

Overall, it seems to be a duplicate of https://github.com/yarnpkg/yarn/issues/2899 and https://github.com/yarnpkg/yarn/issues/1291, so I incentivize you @bnheise to close this issue and keep track of Rust support in future releases of Yarn

bnheise commented 1 year ago

@avmaxim Thanks for replying. Unfortunately, I can't remove the dependency ce-cli because that's my actual package. It's not an external dependency, it's a sub-package of the current project that I'm working on. If I remove it, I basically remove my whole project.

bnheise commented 1 year ago

@avmaxim I'm aware of the Rust based package, ce-cli, but that is not a dependency of this project. It's a coincidence that my sub-project and that project have the same name. My project does not use rust at all.

abhishek-quck commented 6 days ago

@babel/core@npm7.24.7 is not supported by any available linker . Anyone please help how can i get rid of this error while i am adding a dependency with yarn add , this error originated by the command yarn add vue-cli-service