I'm working on git bash cmd. When I try run ng
command e.g. ng serve
or ng gc new-component
I see this output:
C:\Users\user\AppData\Roaming\npm/node_modules/node/bin/node: line 1: This: command not found
In the middle of output I see problem with left and right slash. How can I fix it?
I suppose, it isn't problem with environment paths, because all ng commands are working in Windows cmd or PowerShell.
The error “ng command not found” occurs when your system's shell cannot find the path to the ng cli binary. There are three major causes of this error: The ng CLI is not installed. The ng CLI is located in a different directory.
Use the command ng --version (or ng -v ) to find the version of Angular CLI in the current folder. Run it outside of the Angular project, to find out the globally installed version of Angular. Use the npm list --depth 0 to find out the list of packages installed in the current folder.
The ng new command creates an Angular workspace folder and generates a new application skeleton. A workspace can contain multiple applications and libraries. The initial application created by the ng new command is at the top level of the workspace.
ng binary is located inside of bin/ (or in the folder specified at the next line).
Please see comments from @steveswork at: https://github.com/nodejs/node/issues/29287
You have to delete C:/Users/user/AppData/Roaming/npm and C:/Users/user/AppData/Roaming/npm-cache and reinstall global npm modules.
(This typically happens after an upgrade or downgrade of node)
Good Luck.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With