简体   繁体   中英

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彩色控制台输出不可读

How can i disable those colors?

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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM