nestjs / nest-cli

CLI tool for Nest applications 🍹
https://nestjs.com
Other
1.95k stars 390 forks source link

NestJs CLI prints strange message #1480

Closed ulisses-cruz closed 2 years ago

ulisses-cruz commented 2 years ago

Is there an existing issue for this?

Current behavior

image

Minimum reproduction code

npx @nestjs/cli -h

Steps to reproduce

npx @nestjs/cli -h

Expected behavior

should show the help message for the nestjs cli

Package version

last

NestJS version

No response

Node.js version

17.2.0

In which operating systems have you tested?

Other

If it is not a problem of my computer, maybe nestjs cli repo was hacked

DylanMorison commented 2 years ago

I am having this problem as well on ubuntu

pamelaschuldiner commented 2 years ago

you can read all this here -> https://github.com/Marak/colors.js/commit/074a0f8ed0c31c35d13d28632bd8a049ff136fb6

dpnilsen commented 2 years ago

Same issue on Windows 10. Tried to uninstall and install older version (like 8.1.4, same issue though)

NickKelly1 commented 2 years ago

Same issue on Ubuntu 21.10

Tried on NodeJS v14.17.4 and v17.3.0

Tony133 commented 2 years ago

This is a problem with the color.js package

https://github.com/Marak/colors.js/issues/285

DylanMorison commented 2 years ago

Is there a solution for this that anyone has found?

pamelaschuldiner commented 2 years ago

Is there a solution for this that anyone has found?

Well... you can always fix the version in your package-lock file to the last stable. This is a protest. Nest shouldn't be depending on this package anymore I think... When is Nest (and others depending on this) going to change this? don't know xD

ElvisKnapman commented 2 years ago

same issue within the last hour or so

liquidautumn commented 2 years ago

@pamelaschuldiner Nest has colors dependency through cli-table3 which has pinned colors version already and going to phase it out completely in favor of chalk. This package will be fixed when #1478 merged and released.

pamelaschuldiner commented 2 years ago

@pamelaschuldiner Nest has colors dependency through cli-table3 which has pinned colors version already and going to phase it out completely in favor of chalk. This package will be fixed when #1478 merged and released.

Beautiful then! Thanks!

micalevisk commented 2 years ago

Thus there's nothing we can do (neither on @nestjs/cli source) besides waiting for the next release of @nestjs/cli which depends on the next release of cli-table3.


dependency graph of @nestjs/cli

liquidautumn commented 2 years ago

@micalevisk it can be hotfixed unless real fixes go through the pipeline, ie https://github.com/aws/aws-cdk/pull/18324#issuecomment-1008262155

Duduzera1997 commented 2 years ago

+1

NestJS CLI: Latest NodeJS: 14.18 S.O: MacOS Big Sur

Same problem in Docker build on Github Actions on the command nest build.

jmcdo29 commented 2 years ago

We're aware of the problem, and the solution. Thanks everyone for letting us know. Thank you @liquidautumn for pointing out the PR from renovate as well. We'll have this merged and patched as soon as we can.

Please do not keep adding "+1" or "Same problem here" messages. They add a lot of noise to the day. Simply subscribe to the issue or use reactions to show support.

jmcdo29 commented 2 years ago

Also, until we have this PR made, if you need a way around you can use the resolutions property of your package.json to pin colors to 1.4.0 if you use pnpm or yarn, or you can use npm-force-resolutions for resolve colors to the same version for npm

...
  "resolutions": {
    "colors": "1.4.0"
  }

Updated to version 1.4.0 after @kachkaev pointed out 1.4.1 is also affected

kachkaev commented 2 years ago

"colors": "1.4.1" is also affected – see version history on npm and v1.4.1. on unpkg. The latest safe version to date is 1.4.0 (released on 2019-09-22).

kyawswarthwin commented 2 years ago

Win 11 Node v16.13.1 npm 8.3.0

any temporary solution to work "nest new project-name"?

jmcdo29 commented 2 years ago

git clone the typescript-starter repository and resolve the issue in the local repo. Not much else to be done right now

quyennt21 commented 2 years ago

@kyawswarthwin go to your_global_npm_path/node_module find @nestjs/cli > add

"overrides": { "colors": "1.4.0" } to package.json And run re-install package nestjs/cli

kyawswarthwin commented 2 years ago

@quyennt21 thanks it works.

kyawswarthwin commented 2 years ago

@quyennt21 I can't start my nest project with npm run start. It shows the same error.

quyennt21 commented 2 years ago

@quyennt21 I can't start my nest project with npm run start. It shows the same error.

Change package json in Your_project/node_modules/ nestjs cli.

Mark24Code commented 2 years ago

same issues

nest --help nest -v you will get a mess of chars on screen , sometimes it makes terminal crash.

截屏2022-01-10 下午2 58 14

onldosalm commented 2 years ago

it is a temporary fix!

add to your package.json

"overrides": {
  "cli-table3": "0.6.1"
}

remove unnecessaries

re-install npm modules

npm install
kamilmysliwiec commented 2 years ago

This should be fixed in 8.1.8! Thanks for reporting