Search code examples
node.jsnpmconsole

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?


Solution

  • 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>