2

I have installed nx globally using Sudo

sudo npm install -g nx

and it works fine, but sometimes it gives the below error

bash: line 136: nx: command not found

After retry, it works fine again.

Shashikumar KL
  • 1,007
  • 1
  • 10
  • 25

1 Answers1

1

Check first if adding nrwl/cli would help, as shown here:

sudo npm i -g @nrwl/cli

And check if, in case of error, the $PATH value as seen in the GitLab runner, to understand why it would not see nx.
Using npm run nx as an alternative to nx coud be a workaround in that case.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250