0

Whenever I enter an ng command prompt like "ng new " it redirects me to the ng.js file in the visual studio code and after I close it up and return back to the cmd, all i see is this:

enter image description here

I was expecting it to create and deploy me a new angular project with all the enviroments and such in VScode, however the action it took upon excuting the command was odd. i have ng as a path in my enviroment variables, so i dont know why this is happpening.

  • The `ng` in your path is not the Angular CLI. – Matthieu Riegler Jul 28 '23 at 09:57
  • Can you type "where ng"? What does it say, does it point to your angular global installation? Did you install @angular/cli globally (`npm install --global @angular/cli`) first? Also, perhaps try this: `npx -p @angular/cli ng` to see what happens? – Zlatko Jul 28 '23 at 10:34
  • @Zlatko when i type where ng it points to %USERNAME%\AppData\Roaming\npm\node_modules\@angular\cli\bin\ng.js. – WastedxBusted Jul 28 '23 at 12:05
  • @Zlatko also when i tried to type “npx -p @angular/cli ng” an error appeared that says “Error: you need to specify a command before moving on. Use ‘—help’ to view the availability commands.” As to the global installation command argument, the execution worked without an error. – WastedxBusted Jul 28 '23 at 12:10
  • Then perhaps try `npx -p @agular/cli ng new my-app`. That might work. – Zlatko Jul 29 '23 at 16:27
  • @Zlatko it worked, but do you have any idea as to how i could get rid of the ‘’’npx -p @angular/cli‘’’ ? – WastedxBusted Aug 02 '23 at 08:38
  • Reinstall globally the angular package? Perhaps try forcing it. `npm install --global @angular/cli@latest` - try after that. – Zlatko Aug 02 '23 at 14:23

0 Answers0