

Where is our configuration file written? Why don’t we ask npm: npm config get userconfig It will override the default value (vi) with our new value (vim), and it will also create our configuration file, since it is our first custom value. If we want to change this value, we can easily do that by typing something like this: For instance, if we want to see the current value of the “editor” key, we can type: npm config get editor This is how we work with configuration values within npm. To get more extensive information, we’ll have to pass the -l flag: npm config ls -lĪs you can see, there are many key-value pairs of information. We aren’t shown most of the defaults with this command though. It is simply gathering information from its environment (current directory, etc.) and using the application defaults. Right now, npm is not pulling any information from its configuration files because there are no configuration files that have been created yet. It will suddenly show that the “global” option is set: You can test this by passing the -g flag. This list of settings is pulled from a variety of different places, including the current operating environment. 'npm config ls -l' to show all defaults. cwd = /home/demouser/projects/test_package node bin location = /home/demouser/.nvm/v0.11.13/bin/node Listing the Current Configuration Settingsįirst, let’s see what our current settings are. There are quite a few ways built into npm to do this. To control the behavior of npm, you can adjust the settings for the tool. Now, we’ll cover how to modify configuration settings, create and publish a package, and how to interact with the npm package repository. We have also discussed how to use npm as a package consumer by searching for and acquiring packages. In a past guide, we discussed how to install Node.js on an Ubuntu 14.04 server. In this guide, we will talk about how to use npm, a Node.js package management system. Node.js is a popular Javascript platform for server-side programming that allows you to build and run web apps quickly.
