1

I'm trying to install angular but I cant get my pc to find the ng command. I have tried aliassing, changing the path variable, uninstalling the angular package, updating node and npm.

I think it's a path problem but I'm not too familiar with this.

In the node.js terminal:

C:\Users\Calvin Swinnen>where ng
C:\Program Files\Git\usr\local\node_modules\@angular\cli\bin\ng

In the VSCode integrated terminal:

Calvin Swinnen@DESKTOP-UJODPIS MINGW64 ~/Documents/vakken/web 4/test
$ ng
bash: ng: command not found

Calvin Swinnen@DESKTOP-UJODPIS MINGW64 ~/Documents/vakken/web 4/test
$ npm list -g --depth=0
C:\Program Files\Git\usr\local
+-- @angular/[email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
`-- [email protected]

npm ERR! missing: opn@~5.3.0, required by @angular/[email protected]
npm ERR! missing: yargs-parser@^10.0.0, required by @angular/[email protected]

[![Calvin Swinnen@DESKTOP-UJODPIS MINGW64 ~/Documents/vakken/web 4/test
$ npm root
C:\Users\Calvin Swinnen\node_modules

Calvin Swinnen@DESKTOP-UJODPIS MINGW64 ~/Documents/vakken/web 4/test
$ npm root -g
C:\Program Files\Git\usr\local\node_modules

I have added the global adress to this paths but no succes

Paths in windows

With the alias there is a problem with the space in the path: Maybe I could try this first but it would be nice if it just works without aliassing

Calvin Swinnen@DESKTOP-UJODPIS MINGW64 ~/Documents/vakken/web 4/test
$ alias ng="C:\Program Files\Git\usr\local\node_modules\@angular\cli\bin"

Calvin Swinnen@DESKTOP-UJODPIS MINGW64 ~/Documents/vakken/web 4/test
$ ng
bash: C:Program: command not found

In normal windows terminal

C:\Users\Calvin Swinnen>ng
'ng' is not recognized as an internal or external command,
operable program or batch file.

Thanks in advance, Calvin

6
  • What if you just use a regular cmd prompt? Does it resolve ng command there? Commented May 14, 2018 at 14:40
  • I have added it in the post now, thanks. 'ng' is not recognized as an internal or external command, Commented May 14, 2018 at 14:42
  • What's the command line you used to install angular-cli I noticed your path is referencing to GIT folder, should be under your AppData\Roaming\npm. The command to install angular cli should be npm install -g @angular/cli Here's the link to github of angular-cli Commented May 14, 2018 at 14:45
  • I used git Bash as the integrated terminal in vs code, ill try to install in appdata/roaming/npm with the regular cmd when I get home. Commented May 14, 2018 at 14:58
  • visual studio or visual studio code? Commented May 14, 2018 at 14:58

1 Answer 1

2

I don't know why you want type of custom configuration - may be you'll face error max of the time.

Anyway, put C:\Program Files\Git\usr\local\ as your PATH. Then close all instance of git-bash and vscode and cmd. Then try ng.

Before doing all, try to find ng.cmd in C:\Program Files\Git\usr\local\ ... I hope it will be there.

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

1 Comment

This worked! But what do you mean by custom configuration? I thank you very much

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.