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. |