210

I am unable to install ionic through npm. Are there any logs that I can check to see what's wrong and if yes, where are they located?

What I see is the waiting stick dancing forever. I've waited for an hour or so but nothing changes.

papakias
  • 2,925
  • 3
  • 13
  • 20

1 Answers1

341

Append the --loglevel verbose argument to the command you want to run and all logs will be shown on STDERR and saved to npm-debug.log file in the current working directory.

Example usage: npm install ionic --loglevel verbose.

Running the npm commands like this, shows the logs in realtime and saves the logs to the directory its running within.


For permanent solution, just edit the global npm configuration. To do this, run npm config edit command and add loglevel=verbose. Now every npm command will show detailed logs

Atul Sharma
  • 9,397
  • 10
  • 38
  • 65
  • It's not particularly clear, but some options are documented [here](https://docs.npmjs.com/misc/config). Or alternatively, run `npm help 7 config`. – x-yuri May 28 '19 at 16:37
  • 7
    Update config via command `npm config set loglevel verbose` – Roman Rhrn Nesterov Jun 20 '20 at 11:28
  • 1
    That is not a lot of additional logging. Is there anything that can help debug networking problems? – Jason Jul 14 '20 at 22:07
  • 9
    `-d`, `-dd` and `-ddd` give increasing amounts of output. In my current case only `-ddd` was somewhat helpful, but not even that very much. – Fabian Röling Oct 22 '20 at 12:57
  • 9
    @FabianRöling , `-d` == `--loglevel info` , `-dd` == `--loglevel verbose` , `-ddd` == `--loglevel silly` . See: [Shorthands and Other CLI Niceties § config | npm Docs](https://docs.npmjs.com/cli/v8/using-npm/config#shorthands-and-other-cli-niceties) – li ki Jan 29 '22 at 08:34
  • 3
    this doesn't seem to work if the command doesn't actually error out. – Michael Jul 12 '22 at 20:59
  • for me `npm -ddd i` actually works out like a charm. Keep an eye on the order, before the log verbose and then the command install. – Alberto Sanchez Gonzalez Oct 05 '22 at 15:06
  • 1
    For some reason, this does not work to print output from install scripts. Some module has `const log = require('npmlog'); log.info('install', 'Something ... ')` but npm install command does not print out any of it unless an error happens - then suddenly those info messages get printed. How do I force it to print everything from the module install scripts? – JustAMartin Nov 28 '22 at 14:12
  • Hello I want to know what the verbose flag alone means For example, I want to install npm with the --verbose , what does this mean? npm i --verbose – davood beheshti Jun 26 '23 at 05:26