K
K
Konstantin Kitmanov2015-03-10 15:23:58
Node.js
Konstantin Kitmanov, 2015-03-10 15:23:58

How to avoid creating npm-debug.log when tests fail?

In package.json something like this:

"scripts": {
    "test": "mocha --compilers js:./node_modules/babel/register -u bdd -R spec --recursive test"
  },

If tests fail when running npm test (expected or not), npm complains to the console how bad it is:
npm ERR! [email protected] test: `mocha --compilers js:./node_modules/babel/register -u bdd -R spec --recursive test`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] test script.
npm ERR! This is most likely a problem with the ima-package package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     mocha --compilers js:./node_modules/babel/register -u bdd -R spec --recursive test
npm ERR! You can get their info via:
npm ERR!     npm owner ls ima-package
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 3.16.0-31-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "run" "test"
npm ERR! cwd /mnt/backup/projects/alchemy
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.4.21
npm ERR! code ELIFECYCLE
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian
 
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/user/projects/ima/npm-debug.log
npm ERR! not ok code 0

The same trouble is not only with tests, but also with jscs and eslint. As a result, to see what exactly is broken, you have to scroll up, and npm-debug.log has to be deleted later.
How to get rid of it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Konstantin Kitmanov, 2015-03-11
@k12th

I re-read the documentation again, found the flag--force . The inscription still remains

This failure might be due to the use of legacy binary "node"
, but it's only three lines, not half a screen.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question