Home > database >  nestjs Commands not working without using npx?
nestjs Commands not working without using npx?

Time:09-28

I installed nestjs using npm but it is not working without using npx. For Every nest command I have to write npx ahead like

npx nest -v

otherwise it does'nt work.

also it shows error in @nestjs/core and other nestjs packages.

due to this I am not able to run projects.

OS : Windows

CodePudding user response:

Maybe you installed NPM without its global dependency binaries on PATH environment variable. The path to NPM binaries looks like: C:\Users\user-pc\AppData\Roaming\npm

  • After setting up the PATH, if you opened the terminal via File Explorer, you've to restart the explorer and launch the terminal again. The same applies if you used a code editor app such as Visual Studio Code to launch the terminal.

CodePudding user response:

go to

C:\Users\user\.npmrc

and there change there change the changed the prefix value there from ~ to user\npm-global it should look something like

prefix=C:\Users\{username}\npm-global

there should be no files between {username} and npm-global

  • Related