3

I created a new angular project, i wanted to setup the tests based on the documentation.

So i ran:

ng test

But the output is not what i expected:

t̸̡̙̪͙͎̼̬̮̣̜̜̤͉̬͚̰͚̙͉̮̥̜̞͕̬̝̻͕̬̭͍̦̫̳͈̯̰̳̹̭̦͈̦͔̲̱̒͗̄͊ͥ̈̏́ͧ̊̔̿̚͟͡͝ͅͅé̴̝͍͉̣̹̯̖̯͓̘̠͇͍͙̭̙̻̬͖̫̯̘̟͎̤̯ͭ͐ͥ̒ͦ͒̓̀̐̋ͤ͟ș̷̴͔͈͎͖̙̞̹̍̓ͬ̓ͬ̈̓̃ͦ̌̔͒̊ͧ̓̂ͦ͝͞ț̨̧͍̩̬̟̺̦͇̜̜̣̳͇͓͂̓̊̂ͭ̏̏ͩ͌̎̿̈͗ͧ̓́̒̿͘͟į̰̲̤̖̲͇̲̣̻̘̗̤͍̖͖̠̖̟͔̞͎͚͎͉̫͇͍̻͙͚͈̥͎̼̻̝̜͍̭̗̩̳̖͙̫͈͕̩̱̹̮̹̯̪͚̺͔͙̜͉̣͚ͤ͑̓̅̈͆̀̃ͮ̋ͤͧ́̕ͅͅͅͅn̶̵̰̜̲̗͎̯͈̰̰̼̯̦̞̫̞̠̥͈̖̬̼̖̻̹̤͎̥̳̠̟̺̮̯̭̟̮̻̫̗͈͖͖͍͔̤̉́̈͆̅ͣ̀̈̃̈̅̓ͤ̀̏̾ͣ̅́ͅͅͅgͦ͐̏ͧ̌̍ ҉̷̨̣̰͈̪̭͔̼͈͕͇̼͚͖͎̞͍̮̬̣̩͍̼͈̟̖̜͎͉̳̱͇̱̤̦̤̩̞̮̳͜͡ͅ ̈̌̇ͥͬ͐̌ͣ̒͋͗́͛ͩ̓̈̃̚͟ ҉̵̬͕̦̤̰͚̬͎̗̰͈̳̱͇̯̟̼̜̜̰͖ṱ̶̨̢̛̩̫̮̺̣̯̬̣͎̠̟̤͎̞͕̦̠̰̫̱̖̱̪͙͙̫̞͔͙̜͓͔͙͉̗͙̞̳̜̰͕͇͚͓̞̭̲̰͙̲̲̤͇̘̥̲̉ͬͪ̇͡ͅͅͅͅè̴̸̛̪͓͚̘̞̙͈̫̦͓̰͚̼͇̦̤͔͈̫͍̪̠͍̬̥̭̙̠̥̗̺͇͙̣̲͈̞̲͍̻͓̖͙͙ͨ̏̀͆ͤͮ̋̾̋͘s̵̞̞͈̮̫̭͔̬̹̻͍̳͕͎̭͎̗̗͚͔̖̰̭̣̙̪̱͓̥̺̣̠̗̝͔̞̱̩̥̲̰̠͎̱͓̻̼͓̪̩̼̤̍̍̈̑ͤ̓̓̉̓̇ͨͮ̋̋̀͋̕͜t̜̰̮͉̲̺̣ͧ̅͋ͥ͊ͤͭͪ͑ͪ͐̍̑ͬ̄͐̌́̚͡i̴̪̹̲̲͚͈̝̼͙̊͂ͪͨ̌ͨ̊̏͆ͧ̉̅́̀̀̋͂ͦ͟͢͞n̴̡̖̖̬̪̲̰̪̝͓͖̺̯̯̬͖͚͚̼͖͖̠̝̙͈̥̩̤̮̲̭̝̯͎͚͎̳̤͚͈͓̟͓̟͓̪͎̮̥̩̯͙̞͔̻̹̖͚ͣͤ̃͒̈̑ͩͩͩ͢͡ͅģ̶̠̗͔̖͉̲̝͉̻̟̮̤̖͈̯͎̮̰͈͙͔̽̑ͦ̇͑̆́͐͐̅̇̓ͭ͑̅́ ̧̢̙̱͓͈̯̮̤̬͍̪̬̲̠̖͎̙̠̖̘ͬ̇͛̏̆̎̀͘͡ͅt̴̸̢̝̯̮̣͖̝̫̞͍̹̯̱̣̦͙̲͇̙͈̗̭͉̪͕̬͚̺̝͍̼̹̼͉̯ͫ̌̅̓̽̒͆͌̇́̊͟ͅͅe̟̲̥̰̤͍̭͙̦̙̤̬̳͍̰͙͕̞̜̺̰̻͇̞̱̗̤̤͔̲̠̯͕̳ͯ̄̂ͥ̊́͘͘͘ṣ̸̴̢̯̯͉͎̥̤͔̫̭̝̩̥̟̓͊ͮ̃ͭ̽ͯ̈̏̆̇̏̈̏ͫ͘͢ͅt̑̅͒ͨͩ̐̈ͤ̀ ҉̴̻̲̥͔̼̖̥͕͔̥͔̭͖̼̹̹͎͓͇̬̼̲͎̦͕͇͕̫̮̠̫̻͎̮̻̗̗͓

I tried to update ng and create a new project and change nothing. Then i ran again

ng test

But i still have the same result, how would you fix that ?

3
  • Hello. This is probably OS IDE/termninal specific. Does every ng cli command look weird or just ng test/ Commented Jan 10, 2022 at 9:24
  • 3
    prolly bleepingcomputer.com/news/security/… Commented Jan 10, 2022 at 9:27
  • @danvid No it's only for ng test, other command on ng cli works fine. Commented Jan 10, 2022 at 9:35

2 Answers 2

6

Here is more details about the fix. It is indeed the problem that @Vikas mentioned.

To put the problem in evidence :

  • launch ng test >> "res.txt"
  • When the file res.txt grows stop the command with CTRL+C and open it with Notepadd++
  • You can see code like that "! H|H|H|H|H H__________________________________ H|┬º|┬º|┬º|H H|* * * * *" and it ends with the name of Carl Pilcher

If you search for "Pilcher" in node_modules, you will find his name in node_modules\colors\lib\custom\american.js
To solve the problem, as mentioned :

  • launch npm install if package-lock.json has been deleted so that it is created again
  • Change the version of colors : before :
"colors": {
  "version": "1.4.2",
  "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.2.tgz",
  "integrity": "sha512-5QhJWPFZqkKIieXJPpCprdOytvH7v0AGWpu9K2jZ4LWkGg3dVBNoYPgGGRpEsc0jb8Boy0ElYrdjH9uXfhRSqw==",
  "dev": true
},

after :

"colors": {
  "version": "1.4.0",
  "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz",
  "integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==",
  "dev": true
},
  • launch a npm install to downgrade the color package

    The best way would be to ask the editor to upgrade without the node_modules\colors\lib\custom\american.js
Sign up to request clarification or add additional context in comments.

1 Comment

Instead of manipulating the file package-lock.json, you can also enter the following command: npm install [email protected] In the meantime, NPM has also removed the defective version.
4

As @Vikas mentioned it was linked to that news: https://www.bleepingcomputer.com/news/security/dev-corrupts-npm-libs-colors-and-faker-breaking-thousands-of-apps/

To fix it I searched for /colors inside my package-lock.json. I found two occurrences:

I changed the version from 1.4.2 to 1.4.0, the lines look like that:

    "node_modules/colors": {
      "version": "1.4.0",
      "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz",
      "integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==",
      "dev": true,
      "engines": {
        "node": ">=0.1.90"
      }
    },
    "colors": {
      "version": "1.4.0",
      "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz",
      "integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==",
      "dev": true
    },

2 Comments

Instead of manipulating the file package-lock.json, you can also enter the following command: npm install [email protected] In the meantime, NPM has also removed the defective version.
I already have colors 1.4.0. but i still get that

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.