Pawel
Pawel

Reputation: 537

Git bash can not run any ng command (Angular CLI)

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.

Upvotes: 6

Views: 4213

Answers (1)

Mamun
Mamun

Reputation: 2534

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.

Upvotes: 8

Related Questions