Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

nx command not found on gitlab-runner

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.

like image 739
Shashikumar KL Avatar asked Jun 18 '26 21:06

Shashikumar KL


1 Answers

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.

like image 116
VonC Avatar answered Jun 22 '26 00:06

VonC



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!