Search code examples
jiranpm-installjira-rest-apijira-forge

Installing @Forge/cli is bringing spawn ts-node ENOENT error


I followed this tutorial Getting started on Jira development.

I’m on a Mac so I went through those steps: Installing Forge on macOS successfully.

When I install forge Globally: npm install -g @forge/cli

I get this error:

events.js:291
      throw er; // Unhandled 'error' event
      ^

Error: spawn ts-node ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:268:19)
    at onErrorNT (internal/child_process.js:470:16)
    at processTicksAndRejections (internal/process/task_queues.js:84:21)
Emitted 'error' event on ChildProcess instance at:
    at Process.ChildProcess._handle.onexit (internal/child_process.js:274:12)
    at onErrorNT (internal/child_process.js:470:16)
    at processTicksAndRejections (internal/process/task_queues.js:84:21) {
  errno: 'ENOENT',
  code: 'ENOENT',
  syscall: 'spawn ts-node',
  path: 'ts-node',
  spawnargs: [
    '/Users/soud/.nvm/versions/node/v12.22.6/lib/node_modules/@forge/cli/out/workers/forge-cli-workers.ts',
    '{"name":"@forge/cli","checkForUpdate":true,"environment":"prod"}'
  ]
}

Solution

  • Here the answer I got from the Forum:

    looking at the error and at our postinstall script, it seems like you may have NODE_ENV=development set in your shell environment.

    Perhaps you had set it earlier in the same terminal session, or maybe it’s set in your bashrc or bash_profile?

    To confirm whether this is the issue, you could unset the NODE_ENV in your terminal session before running npm install -g @forge/cli by running unset NODE_ENV.