npm, npx
npm stands for Node Package Manager. It is the default package manager for the JavaScript runtime environment Node.js. npm allows developers to:
- Install Packages
- Manage Dependencies: Automatically handle and manage dependencies for a project
- Run Scripts: execute scripts defined in the package.json file, such as build, test and start scripts
- Publish Packages
Install a package using npm:
npm install package-name
# Install globally
npm install -g package-nameTo initialize a new Node.js project and create a package.json file, you can use:
npm initnpx is a command-line tool that comes with npm. It allows you to execute binaries from npm packages without globally installing them. This is particularly useful for running one-off commands or scripts from npm packages.
Configuration file
Location (both windows and linux):
~/.npmrc
Proxy settings:
proxy=http://yourproxy.net:80
https-proxy=http://yourproxy.net:80