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 ?
CodePudding user response:
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
},
CodePudding user response:
Here is more details about the fix. It is indeed the problem that @Vikas mentionned.
To put the problem in evidence :
- launch ng test >> "res.txt"
- When the file res.txt growns 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 mentionned :
- 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"
