0

I am using Visual Studio Code's integrated terminal, which I have changed to bash but commands like ng and tsc don't work. It doesn't recognize them.

Any guesses why that is the case?

2 Answers 2

1

have you installed the angular-cli as a GLOBAL package? and also tsc and so on ...

so double check if you've done for example:

npm install -g @angular/cli

npm install -g tsc 

..and so on ...

the -g (or --globally) param is the key .. cause it made your package 'global' on your pc

Sign up to request clarification or add additional context in comments.

8 Comments

Hi Federico, Yes, I used -g param while installing my packages but it doesn't work.
what if you try to write in the shell ng -v?
have you tried to run it as root? ..so with sudo npm install -g @angular/cli ?
Yes, that works fine on my git bash but it only bugs me inside VS terminal.
This happens if you open the angular project directly, I fixed it by opening that project with the git command code . it makes the commands work fine inside VS Code integrated terminal
|
0

Just configure you VSCode terminal to run the Node.js command prompt, usually located in:

c:\Program Files\nodejs\nodevars.bat

To run automatically, edit the config user settings like this:

"terminal.integrated.shellArgs.windows": [
    "\/k C:\\\"Program Files\"\\nodejs\\nodevars.bat"
]

Comments

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.