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

nx generate process failed to launch #2112

Closed
1 of 4 tasks
chriscurnow opened this issue Apr 27, 2024 · 2 comments
Closed
1 of 4 tasks

nx generate process failed to launch #2112

chriscurnow opened this issue Apr 27, 2024 · 2 comments
Labels
type: bug Something isn't working

Comments

@chriscurnow
Copy link

Current Behavior

If I run nx generate from the Nx Console, I get an error:
The terminal process "/bin/zsh '-l', '-c', 'npx nx generate @nx/angular:library [lib-name] --no-interactive --dry-run'" failed to launch (exit code: 1).

Expected Behavior

It should run the generator

GitHub Repo

https://github.com/4Cast/nx-generate-error

Steps to Reproduce

  1. Create new Angular monorepo using instructions in tutorial https://nx.dev/getting-started/tutorials/angular-monorepo-tutorial
  2. Working in VS Code with Nx Console installed, select Nx Console from the VS Code menu
  3. Select generate
  4. I can select any generator here and it gives the same result but for now, say I select @nx/angular - library
  5. Type library name and the error appears

NOTE:
If I type nx generate ... from the command line, it works.

Nx Report

Node   : 18.17.0
OS     : darwin-x64
npm    : 9.6.7

nx (global)        : 18.0.8
nx                 : 18.3.4
@nx/js             : 18.3.4
@nx/jest           : 18.3.4
@nx/linter         : 18.3.4
@nx/eslint         : 18.3.4
@nx/workspace      : 18.3.4
@nx/angular        : 18.3.4
@nx/cypress        : 18.3.4
@nx/devkit         : 18.3.4
@nx/eslint-plugin  : 18.3.4
@nrwl/tao          : 18.3.4
@nx/web            : 18.3.4
@nx/webpack        : 18.3.4
typescript         : 5.4.5
---------------------------------------
Registered Plugins:
@nx/cypress/plugin
@nx/eslint/plugin

Failure Logs

Executing task in folder angular-monorepo: npx nx generate @nx/angular:library feature-sol --no-interactive --dry-run 

/Users/chriscurnow/.nvm/versions/node/v18.17.0/lib/node_modules/npm/node_modules/@npmcli/config/lib/index.js:193
  #get (key, where = null) {
       ^

SyntaxError: Unexpected token '('
    at Module._compile (internal/modules/cjs/loader.js:892:18)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
    at Module.load (internal/modules/cjs/loader.js:812:32)
    at Function.Module._load (internal/modules/cjs/loader.js:724:14)
    at Module.require (internal/modules/cjs/loader.js:849:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/Users/chriscurnow/.nvm/versions/node/v18.17.0/lib/node_modules/npm/lib/utils/config/definition.js:33:5)
    at Module._compile (internal/modules/cjs/loader.js:956:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
    at Module.load (internal/modules/cjs/loader.js:812:32)

 *  The terminal process "/bin/zsh '-l', '-c', 'npx nx generate @nx/angular:library feature-sol --no-interactive --dry-run'" failed to launch (exit code: 1). 
 *  Terminal will be reused by tasks, press any key to close it.

Package Manager Version

No response

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

This has been happening for a while.

It is only today I got around to testing it with a brand new angular monorepo and creating a GitHub repo for it.

I did try searching existing issues but couldn't find anything.

@chriscurnow chriscurnow added the type: bug Something isn't working label Apr 27, 2024
@AgentEnder AgentEnder transferred this issue from nrwl/nx Apr 29, 2024
@chriscurnow
Copy link
Author

Sorry, this is a repeat of my earlier issue #1857.

The solution is in the comments to that issue.

@MaxKless
Copy link
Collaborator

MaxKless commented May 6, 2024

glad to hear you figured it out!

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

No branches or pull requests

2 participants