Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: yarn create not working for Yarn Berry #1203

Closed
kpanot opened this issue Jan 11, 2024 · 1 comment · Fixed by #1281
Closed

[Bug]: yarn create not working for Yarn Berry #1203

kpanot opened this issue Jan 11, 2024 · 1 comment · Fixed by #1281
Labels
bug Something isn't working

Comments

@kpanot
Copy link
Contributor

kpanot commented Jan 11, 2024

Package name

create

Package version

Reproduction steps

  • yarn version: 2+ (globally installed)
  • Node version: 20+

Run command :

yarn  create @o3r@10.0.0-next.48 my-project

Current result

Output in the console:

Node.js version v21.5.0 detected.
Odd numbered Node.js versions will not enter LTS status and should not be used for production. For more information, please see https://nodejs.org/en/about/previous-releases/.
(node:58675) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
(node:58675) ExperimentalWarning: Use `importAttributes` instead of `importAssertions`
(Use `node --trace-warnings ...` to show where the warning was created)
An unhandled exception occurred: Collection "@schematics/angular" cannot be resolved.
See "/private/var/folders/zx/zfjy1z9523s5mf5086mw8ysh0000gp/T/ng-HgfMfg/angular-errors.log" for further details.

Error: spawnSync /opt/homebrew/Cellar/node/21.5.0/bin/node ENOENT
    at Object.spawnSync (node:internal/child_process:1124:20)
    at spawnSync (node:child_process:876:24)
    at addOtterFramework (/Users/kpanot/.yarn/berry/cache/@o3r-create-npm-10.0.0-next.48-abbde844e8-8.zip/node_modules/@o3r/create/index.js:115:58)
    at Object.<anonymous> (/Users/kpanot/.yarn/berry/cache/@o3r-create-npm-10.0.0-next.48-abbde844e8-8.zip/node_modules/@o3r/create/index.js:128:1)
    at loadCJSModule (node:internal/modules/esm/translators:270:3)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:307:7)
    at ModuleJob.run (node:internal/modules/esm/module_job:218:25)
    at async ModuleLoader.import (node:internal/modules/esm/loader:329:24)
    at async loadESM (node:internal/process/esm_loader:28:7)
    at async handleMainPromise (node:internal/modules/run_main:120:12) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawnSync /opt/homebrew/Cellar/node/21.5.0/bin/node',
  path: '/opt/homebrew/Cellar/node/21.5.0/bin/node',
  spawnargs: [
    '/Users/kpanot/.yarn/berry/cache/@angular-cli-npm-17.0.10-1aeefc94f3-8.zip/node_modules/@angular/cli/bin/ng.js',
    'add',
    '@o3r/core@10.0.0-next.48',
    '--style',
    '--package-manager',
    '--no-create-application'
  ]
}

Content of the error logfile:

[error] Error: Collection "@schematics/angular" cannot be resolved.
    at SchematicEngineHost.resolve (/Users/kpanot/.yarn/berry/cache/@angular-devkit-schematics-npm-17.0.10-62b3a07140-8.zip/node_modules/@angular-devkit/schematics/tools/node-module-engine-host.js:86:19)
    at SchematicEngineHost._resolveCollectionPath (/Users/kpanot/.yarn/berry/cache/@angular-devkit-schematics-npm-17.0.10-62b3a07140-8.zip/node_modules/@angular-devkit/schematics/tools/node-module-engine-host.js:91:37)
    at SchematicEngineHost.createCollectionDescription (/Users/kpanot/.yarn/berry/cache/@angular-devkit-schematics-npm-17.0.10-62b3a07140-8.zip/node_modules/@angular-devkit/schematics/tools/file-system-engine-host-base.js:116:27)
    at SchematicEngine._createCollectionDescription (/Users/kpanot/.yarn/berry/cache/@angular-devkit-schematics-npm-17.0.10-62b3a07140-8.zip/node_modules/@angular-devkit/schematics/src/engine/engine.js:167:40)
    at SchematicEngine.createCollection (/Users/kpanot/.yarn/berry/cache/@angular-devkit-schematics-npm-17.0.10-62b3a07140-8.zip/node_modules/@angular-devkit/schematics/src/engine/engine.js:160:43)
    at NewCommandModule.getCollectionFromConfig (/Users/kpanot/.yarn/berry/cache/@angular-cli-npm-17.0.10-1aeefc94f3-8.zip/node_modules/@angular/cli/src/commands/new/cli.js:65:48)
    at async NewCommandModule.builder (/Users/kpanot/.yarn/berry/cache/@angular-cli-npm-17.0.10-1aeefc94f3-8.zip/node_modules/@angular/cli/src/commands/new/cli.js:32:15)
    at async runCommand (/Users/kpanot/.yarn/berry/cache/@angular-cli-npm-17.0.10-1aeefc94f3-8.zip/node_modules/@angular/cli/src/command-builder/command-runner.js:73:5)
    at async default_1 (/Users/kpanot/.yarn/berry/cache/@angular-cli-npm-17.0.10-1aeefc94f3-8.zip/node_modules/@angular/cli/lib/cli/index.js:70:16)

Expected result

My workspace generated

Additional comments

No response

@kpanot kpanot added the bug Something isn't working label Jan 11, 2024
@kpanot kpanot added this to the On boarding improvement milestone Jan 11, 2024
@kpanot
Copy link
Contributor Author

kpanot commented Jan 15, 2024

Related to #1189

@kpanot kpanot linked a pull request Jan 23, 2024 that will close this issue
github-merge-queue bot pushed a commit that referenced this issue Jan 26, 2024
## Proposed change

Run ngAdd in new project context

## Related issues

- 🐛 fixes #1203
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant