I'm assuming you are using node 18. Change your node version to LTS to run into less issues. A lot of modern packages use LTS as their dependency, not node 18.
To Do:
Download node LTS (Right now - 16.17.1). I would recommend doing it through homebrew and download the "nvm" package. brew install nvm
Then run nvm
to make sure you get a output from the terminal. If you don't see any output, try installing nvm again through homebrew or other debugging methods.
Then go to your root (on mac cd ~
) and run nvm ls-remote
and that will show you a long list. You only care about LTS, items highlighted, and the very latest versions.
nvm install v16.17.1
Check you have the correct version, node -v
. If it still shows the newer version run a nvm use v16.17.1
but usually they set it as your default.
With nvm you can also set profiles, switch between LTS and other versions. Sometimes you might want to use node 12 on a docker container. That is the benefit of having a tool like nvm.