Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Output debug to file from 'npm install' via maven frontend plugin or via commandline options?

We use maven + frontend to execute npm, node and ember to create an ember app. Sometimes this process hangs on 'npm install' with no useful data in log files. I'd like to:

  • get better insight by increasing log level
  • avoid obscuring other log info with debug messages

In a perfect world, I'd add command line options to

  • set npm commands log level to debug
  • output to a file

Then, I'd use a maven profile for ensure the build system always logs with max verbosity while still allowing developers to see important log info.

If you can tell me the command line options or file settings or direct me to the relevant docs then I'll happily modify my pom and post that as a solution here.

Thanks

Peter

like image 872
Peter Kahn Avatar asked Nov 23 '15 17:11

Peter Kahn


People also ask

What does frontend Maven plugin do?

This plugin downloads/installs Node and NPM locally for your project, runs npm install , and then any combination of Bower, Grunt, Gulp, Jspm, Karma, or Webpack. It's supposed to work on Windows, OS X and Linux.

What is npm debug log?

When a package fails to install or publish, the npm CLI will generate an npm-debug. log file. This log file can help you figure out what went wrong. If you need to generate a npm-debug. log file, you can run one of these commands.

How to run npm test in intellij?

In the embedded Terminal ( Alt+F12 ) , type one of the following commands: npm install mocha for local installation in your project. npm install -g mocha for global installation. npm install --save-dev mocha to install Mocha as a development dependency.

What is COM Github Eirslett?

com.github.eirslett » frontend-maven-pluginApache. This Maven plugin lets you install Node/NPM locally for your project, install dependencies with NPM, install dependencies with bower or jspm, run Grunt or gulp tasks, and/or run Karma tests. Last Release on Dec 29, 2021.


1 Answers

Have you tried these flags?

-dd, --verbose: --loglevel verbose

-ddd: --loglevel silly

As far as logging to a file, according to https://docs.npmjs.com/misc/config#loglevel any errors that occur will be logged to npm-debug.log

If you want to adjust that, you can redirect stdout and stderr to a file

npm install -ddd &> filename.txt

like image 74
David Duncan Avatar answered Sep 22 '22 20:09

David Duncan