Request for v3: Remove ANSI formatting codes from package install output

Currently, if you look at the install log from the palette manager, you may get something like:

2022-02-12T23:42:38.158Z Install : node-red-contrib-telegrambot 11.2.3

2022-02-12T23:42:38.195Z npm.cmd install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production --engine-strict node-red-contrib-telegrambot@11.2.3
2022-02-12T23:42:52.101Z [err] e[37;40mnpme[0m
2022-02-12T23:42:52.102Z [err]  e[0me[30;43mWARNe[0m e[0me[35mdeprecatede[0m har-validator@5.1.5: this library is no longer supported
2022-02-12T23:42:52.102Z [err] e[0m
2022-02-12T23:42:52.239Z [err] e[37;40mnpme[0m
2022-02-12T23:42:52.240Z [err]  e[0me[30;43mWARNe[0m e[0me[35mdeprecatede[0m request-promise@4.2.6: request-promise has been deprecated because it extends the now deprecated request package, see
2022-02-12T23:42:52.240Z [err] e[0m
2022-02-12T23:42:52.343Z [err] e[37;40mnpme[0m
2022-02-12T23:42:52.343Z [err]  e[0me[30;43mWARNe[0m e[0me[35mdeprecatede[0m uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See for details.
2022-02-12T23:42:52.343Z [err] e[0m
2022-02-12T23:42:52.349Z [err] e[37;40mnpme[0m e[0m
2022-02-12T23:42:52.350Z [err] e[30;43mWARNe[0m e[0me[35mdeprecatede[0m request@2.88.2: request has been deprecated, see
2022-02-12T23:42:52.350Z [err] e[0m
2022-02-12T23:42:55.050Z [out] 
2022-02-12T23:42:55.050Z [out] added 96 packages in 15s
2022-02-12T23:42:55.099Z rc=0

It would be really nice if those ANSI characters were got rid of to make it easier to read.

The fix is easy enough, just add --color=false to the npm command.

1 Like

Odd that I don't see them anywhere I run.

But yes, it's a quick PR if anyone was so inclined.

I suspect that it depends on how you run NR and what default terminal it picks up. There will be a flag in the terminal somewhere that declares whether it supports colour so when you run a command, it will be inheriting that setting despite the fact that it is actually running in an environment that doesn't actually support ANSI colour.

while yes an easy PR for someone to do - you can also just run npm config set color false to configure your local npm environment

You could, but then you wouldn't get the colour output when you actually want it - ie when you are actually in the terminal. :grinning:

I had the same problem with the npm commands in uibuilder which is why I knew the answer.

meh - colour/readability - pays your money - takes your choice. just suggesting it as a workaround while waiting for v3.

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.