Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Show requests when running npm install

Tags:

node.js

npm

After upgrading to the latest version of npm, the requests are not shown anymore.

$ npm --version
1.4.13

Now, pretty ASCII animation is displayed when the packages are installed - that I love, but how can I see the requests that are made? I mean these ones:

npm http GET https://registry.npmjs.org/<package-name>
...

Is there any option for npm install to enable this feature?

like image 735
Ionică Bizău Avatar asked Jun 08 '14 06:06

Ionică Bizău


People also ask

How do I view npm logs?

To find your . npm directory, use npm config get cache . If you use a CI environment, your logs are likely located elsewhere. For example, in Travis CI, you can find them in the /home/travis/build directory.

What happens when you run npm install?

When npm install is run with a specified package argument, it installs the package in the existing node_modules directory. You can optionally provide a specific version as well... When a version is not provided, npm automatically downloads the latest stable version.

Where are npm install logs?

The default location of the logs directory is a directory named _logs inside the npm cache. This can be changed with the logs-dir config option.


1 Answers

Seems like they have changed default loglevel.

npm install --loglevel http

You can also add this line to your ~/.npmrc:

loglevel = http

Note that this is ini format. You must add this line at the global section, e.g. at the first line of the file.

More info: https://www.npmjs.org/doc/misc/npm-config.html

like image 115
zarkone Avatar answered Oct 06 '22 03:10

zarkone