ngx-rocket / generator-ngx-rocket

:rocket: Extensible Angular 14+ enterprise-grade project generator
https://ngx-rocket.github.io/
MIT License
1.53k stars 216 forks source link

Error on "ngx new" with ngx-deploy-docker #634

Open nzedler opened 1 year ago

nzedler commented 1 year ago

I'm submitting a...

Current behavior


...
added 1931 packages, and audited 1932 packages in 1m

240 packages are looking for funding
  run `npm fund` for details

6 high severity vulnerabilities

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.

Configuring deployment with Docker, please wait…

✖ An error occured while running ngx-rocket#end
node:internal/errors:490
    ErrorCaptureStackTrace(err);
    ^

Error: Command failed with ENOENT: ng add ngx-deploy-docker
spawnSync ng ENOENT
    at Object.spawnSync (node:internal/child_process:1110:20)
    at Object.spawnSync (node:child_process:871:24)
    at module.exports.sync (/Users/nzedler/.nvm/versions/node/v18.14.2/lib/node_modules/generator-ngx-rocket/node_modules/yeoman-generator/node_modules/execa/index.js:174:25)
    at spawnCommand.spawnCommandSync (/Users/nzedler/.nvm/versions/node/v18.14.2/lib/node_modules/generator-ngx-rocket/node_modules/yeoman-generator/lib/actions/spawn-command.js:35:16)
    at CoreGenerator.end (/Users/nzedler/.nvm/versions/node/v18.14.2/lib/node_modules/generator-ngx-rocket/generators/app/index.js:238:27)
    at Object. (/Users/nzedler/.nvm/versions/node/v18.14.2/lib/node_modules/generator-ngx-rocket/node_modules/yeoman-generator/lib/index.js:1092:23)
    at /Users/nzedler/.nvm/versions/node/v18.14.2/lib/node_modules/generator-ngx-rocket/node_modules/run-async/index.js:49:25
    at new Promise ()
    at /Users/nzedler/.nvm/versions/node/v18.14.2/lib/node_modules/generator-ngx-rocket/node_modules/run-async/index.js:26:19
    at /Users/nzedler/.nvm/versions/node/v18.14.2/lib/node_modules/generator-ngx-rocket/node_modules/yeoman-generator/lib/index.js:1093:9 {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawnSync ng',
  path: 'ng',
  spawnargs: [ 'add', 'ngx-deploy-docker' ],
  originalMessage: 'spawnSync ng ENOENT',
  shortMessage: 'Command failed with ENOENT: ng add ngx-deploy-docker\nspawnSync ng ENOENT',
  command: 'ng add ngx-deploy-docker',
  escapedCommand: 'ng add ngx-deploy-docker',
  exitCode: undefined,
  signal: undefined,
  signalDescription: undefined,
  stdout: '',
  stderr: '',
  failed: true,
  timedOut: false,
  isCanceled: false,
  killed: false
}

Node.js v18.14.2

Expected behavior

No error for ngx-deploy-docker

Minimal reproduction of the problem with instructions

Select the docker deployment option when running ngx new.

Environment



ngX-Rocket: 11.0.0
Node.js: v18.14.2
Npm: 9.5.0
OS: darwin arm64 22.2.0

Generated project options:
{
  "generator-ngx-rocket": {
    "version": "11.0.0",
    "props": {
      "location": "path",
      "strict": true,
      "skipInstall": false,
      "skipQuickstart": false,
      "initGit": true,
      "usePrefix": true,
      "appName": "test angular",
      "target": [
        "web"
      ],
      "ui": "ionic",
      "layout": "side-menu",
      "features": [
        "pwa",
        "auth",
        "lazy",
        "cypress"
      ],
      "languages": [
        "de-DE",
        "en-US"
      ],
      "tools": [
        "prettier",
        "hads",
        "compodoc",
        "jest"
      ],
      "utility": [
        "lodash",
        "datefns"
      ],
      "deploy": "docker",
      "projectName": "test-angular",
      "packageManager": "npm",
      "mobile": [],
      "desktop": [],
      "pwa": true,
      "auth": true,
      "lazy": true,
      "e2e": false,
      "cypress": true,
      "angulartics": false
    }
  }
}

Others:

OS: Apple M1, Ventura 13.1