Why is there no single easily findable guide on how to do this? Well, there is now. After migrating to a M1/M2 MacBook from it’s Intel predecessors, you will want to do this.
Recently, I tried switching some of my personal projects to Bun. Only to realise that, even after deleting my node_modules I’d run into platform errors with esbuild. Luckily, getting rid of your old node installation and switching to a new one isn’t that hard.
This guide assumes you currently have some non-ARM version of node installed and do not use nvm yet.
First, let’s get rid of the current node installation. To do this, execute the following shell commands: