
However, before you install anything, you should set up a new project folder. npm comes with every Node installation, so you don't have to worry about installing that. To use discord.js, you'll need to install it via npm (Node's package manager). On Linux, you can consult this page open in new window to determine how you should install Node. Use a package manager like Homebrew open in new window with the command brew install node.


Download the latest version from the Node.js website open in new window, open the downloaded file, and follow the steps from the installer. On Windows, it's as simple as installing any other program.

If it outputs v16.9.0 or higher, then you're good to go! Otherwise, continue reading. I had to delete the ~/.config/yarn/global to make this work.Įcho $PATH should contain something that looks like /Users/dkarter/.asdf/installs/nodejs/9.11.1/.npm/bin which should match yarn global bin.To check if you already have Node installed on your machine (e.g., if you're using a VPS), run node -v in your terminal. When done restart your terminal and test to see that everything worked. You can now install yarn again from npm which will put it in your asdf versioned node: npm i -g yarn Source "$HOME/.asdf/completions/asdf.bash" zshrc and insert a dynamic yarn global path: Now you want to find where asdf is being sourced into your. zshrc or equivalent remove the yarn global path (see my previous post about Yarn global)

To correct this, first uninstall yarn from homebrew: brew uninstall yarn Turns out that if you install yarn through homebrew - your global directory will not take into account the asdf node version and path. I recently started using it for Node and noticed that yarn global no longer plays nice with it. The asdf version manager is an awesome tool for managing many different language runtime versions. Using `yarn global` w/ Node through asdf (mac)
