Use one of these links to see the most current install instructions:Īfter you have NVM installed, open a new terminal window, and install the current LTS (Long-Term Support) version of Node.js. The best way I've found to install Node.js is to use Node Version Manager or nvm. There are multiple solutions, but I think the NVM way is a good choice, because it is easy to set up, and it lets you run multiple versions of Node.js on your computer at the same time. If you get a permissions error (something like EACCES), I would recommend uninstalling your current version of Node.js and reinstalling it using NVM as explained below. If you want to test it, run this command to see if there is a permissions problem: npm install -g prettier ![]() If you get an error about permission problems, it means Node.js isn't installed correctly. Try omitting the word sudo in your npm commands. The security problem is that if you use sudo in front on npm, it can give unknown scripts full access to your machine by letting them run with root permissions. If a tutorial tells you to use the keyword sudo in front of your npm commands, be careful, because it means that you are opening up your computer to attacks. A Note on sudo You should NOT use sudo in front of your npm commands. ![]() If node is installed, it will print out the version number, which might be something like v18.0.0 (at the time of writing this). To see if Node.js is installed, type this command in a terminal: node -v ![]() Note: There are a couple of ways to install multiple node versions at once, but I've chosen the nvm method, because the alternate way might confuse beginners who run their code outside of npm and yarn scripts.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |