Npm config help
Publish: This command is essential when developing your own package for npm. Adding -g -depth=0 to this command allows you to also check your globally installed packages.
NPM CONFIG HELP MANUAL
In projects where the root dependency list is hundreds of lines long, a manual check on packages is close to impossible. Outdated: This is used to evaluate the current state of installed dependencies and whether or not they are outdated. It’s cool to see and is also useful for comparisons with other projects. Ls: It’s used to visualize package dependencies and their dependencies, in a tree structure. For example, if you are writing an assembly tool in node that has a CLI installed globally, you can run this command and test your CLI’s behavior without needing to deploy it first. Link: When you are developing your own npm package, this allows you to create a symlink to the global context so it can be tested as if it was installed globally from the npm registry. Back when the npm registry was still a bit unstable, this was essential to get back to a stable environment or to reset things when you didn’t properly set up npm permissions.Ĭonfig: We will get into the different configuration options later, but this command deals primarily with persisting configuration properties in the local or global configuration file by using the set, get or delete subcommands.ĭedupe or ddp: When working on a project over an extensive period of time and installing packages straight from npm, this command will walk the local package tree and attempt to simplify dependencies. Either call it with the ls subcommand to see a list of locally cached packages or with the clean subcommand to clear all packages that are in the cache. Used in conjunction with adduser, owner, team, etc, it gives fine grained control over who has access to what.īin: Where on earth are packages installed? Run this command to see the absolute file path.Ĭache: If you start installing packages from npm left, right, and center, this command is quite useful. It’s used to purge a specific package from the node_modules directory either locally or globally (when adding -g).Īccess: This is the playground of npm user permission administrators within the context npm-organizations and scoped (private) packages.
NPM CONFIG HELP INSTALL
Used to either install a new package locally or globally (when adding -g) or to install dependencies listed in the package.json file (more on that later). Install: It’s mentioned here because of its sheer necessity when working with npm. Here are the core commands that stand out. Querying help ( npm help) spews out an entire array of options, and running npm help-search gives you a list of search results direct from the npm markdown. The CLI is where users spend most of their time interacting with npm, and its help interface is actually helpful. However, npm has loads of additional features, which I’ll walk you through, highlighting those I consider essential, really useful, or just plain awesome. Run npm install to install a package globally (like Mocha, or Angular-CLI)? Just add a -g like so: npm install -g angular-cli mocha.Īdmittedly, most use cases stop at an npm install, and there isn’t a need for anything else. Want to install a specific version? No problem. You can get started by simply running npm install and injecting it into your JavaScript file. It gives you exceptional control over your project’s dependencies and provides a great way to contribute to the open-source world. The multitude of resources are astounding, and even more so, the number of libraries available.Īt first, these libraries are few and easy to maintain however, soon enough dependency hell sets in and a more mature solution is required.Įnter the Node Package Manager (npm) – a JavaScript package manager most notably used in conjunction with Node.js, although it can be used independently as well. Make sure you are logged in to the desired Packages npm registry.JavaScript is easily the most used language when it comes to the development of websites and web applications. For other packages, npm will use the default registry (). a registry in Packages), all packages marked with will be published to/installed from this registry only. For example, after you assign to a particular registry (e.g. An additional feature of scoped packages is the ability to assign scopes to registries. If another user or company publishes their own somepackagename to, there will be no conflicts. After you assign to a package, this scope will be added to the package name, e.g. Typically, this npm feature is used to group packages together and separate private and public packages. To avoid this limitation, we recommend that you use scoped npm packages. The npm client is able to work with only one registry at a time: It is not possible to simultaneously use both and a Space Packages nmp registry.