Search code examples
bashmacoszshoh-my-zsh

zsh and bashrc command not found ts-node


I'm having an issue with macOS, it's a company laptop that has already been set up when I got it.

  • It had zsh.
  • I was working on a project with Java, and the path to Java was not working, each time I launched a new terminal I had to set it up.
  • I thought that the problem would be easier to handle with bash so I tried uninstalling it
  • Zsh is still here, but now I can't use ts-node nore nodemon to run my code (but if I try to run it whith a script in my package.json it will run).
  • I managed to switch to bash by default, but ts-node is still not available.
  • I tried uninstalling and reinstalling ts-node npm and node.

Any idea on how to fix this mess whithout formatting the computer?


Solution

  • The answer was that PATH didn't include node_modules.

    Thank you @deepakchethan.

    I corrected it but had some issues since editing the ~/.bashrc file did not save the path and using terminal with export PATH=$PATH:/Users/<user>/.npm_global/bin didn't work either.

    I had to add the path by editing /etc/bashrc.