Reputation: 545
I set up a fresh angular-app and try to serve it with
ng serve --watch
instead of serving the app a file-editor opens. Why does that happen? How can I resolve this?
Serving with
npm start
works fine
Upvotes: 5
Views: 13701
Reputation: 369
npm config get prefix
in your cmd or powershellDont forget to restart your console
Upvotes: 0
Reputation: 2756
I don't know how I got there, but suddenly ng serve
behaved differently and opened the ng.js
file, in the default editor app actually called Editor
. I run a Windows-11 OS.
I fixed the problem by going going to the environment variables menu, removing one of the values for the PATH variable. I removed the following lin, which pointed to my Angular JS:
C:\path\to\node_modules\@angular\cli\bin
Upvotes: 4
Reputation: 111
Solution :
Just use npx before any nodejs executables.
Eg : npx ng serve -o
Upvotes: 11
Reputation: 545
I was able to resolve this by
Upvotes: 4