Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Node.js: How to disable colors in the console?

Im new to node.js and are currently playing around with npm.

I found that the console output is colored in a weird way on my System, i can only read it when i copypaste it into a text editor. Changing the background back to black and the font-color to white also did not help. Here is a screenshot:

Node.js colored console output unreadable

How can i disable those colors?

like image 700
Nils Lindemann Avatar asked Jul 30 '17 12:07

Nils Lindemann


1 Answers

Disable colors in npm using the next command:

npm config set color false

Alternatively, create a new script inside of your package.json with the next format:

  "scripts": {
    "install": "npm install --no-color"
  }

And use it like this from the command line:

npm run install --save <your_package>
like image 89
Jose Lopez Garcia Avatar answered Sep 24 '22 14:09

Jose Lopez Garcia