npm
npm is the world's largest Software Library (Registry). npm is also a software Package Manager and Installer
Links, Courses and Tutorials about npm.
We recommend that you install
npm using Node Version Manager (nvm) so that you can toggle between different npm versions later:Windows
macOS
Linux
wget https://github.com/coreybutler/nvm-windows/releases/download/1.1.11/nvm-setup.exe
After installation above, verify that
nvm is installed:Terminal
Output
nvm --version
The output should now show a version, for example
0.39.1. Lastly, install Node.js (node) and npm using nvm:Terminal
nvm install --lts
You should now have
node, npx and npm installed:Terminal
Output
node --versionnpm --versionnpx --version
π Congratulations! You can now run JavaScript code with Node.js and install
npm packages!Initialize a project
Terminal
npm init -y
This will create a
package.json file and should be done before installing packages.Install a package
Terminal
npm install effect
Install a package as dev dependency
Dev Dependencies are packages that you only need during development, not in production.
Terminal
npm install -D typescript
Install a package globally
Global packages are not tied to a specific project, but are installed globally on your computer (e.g. CLIs).
Terminal
npm install -g bun
Uninstall a package
Terminal
npm uninstall bun