'Installing angular-cli

angular is pretty new to me and english is not my first language so I apologize in advance. I'm a student and I have to do an app using the MEAN platform. We never worked with any MEAN component, or javascript in college but now I have to do this project. I'm following this tutorial -> https://www.youtube.com/watch?v=wtIvu085uU0&list=PLTPtZWpWLI00vlAPQnDt8OlPwoYxuMCQo&index=4 and everything up to 45 minutes into the video worked just fine. At 45 min it says I have to install @angular/cli but I got errors the first time I did it. Then I tried to type npm install @angular/cli again and then there were no errors. It was just like it should be, like it is in the video. But, when I typed ng new client it said

ng is not recognized as an internal or external command, operable program or batch file.

I don't know what to do, I tried to install angular-cli again for few times but every time it was the same. I'm desperate.

Versions:

node --version = v6.11.3

npm --version = 3.10.10

Windows 10

Errors I get when I type "npm install @angular/cli":

npm ERR! tarball.destroy is not a function
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! github
npm WARN retry will retry, error on last attempt: Error: EBUSY: resource busy or locked, rename 'C:\Users\Loran\AppData\Local\Temp\npm-9616-ee3846a1\registry.npmjs.org\eventemitter3-\eventemitter3-1.2.0.tgz.1057597416' -> 'C:\Users\Loran\AppData\Local\Temp\npm-9616-ee3846a1\registry.npmjs.org\eventemitter3-\eventemitter3-1.2.0.tgz'
npm ERR! Windows_NT 10.0.15063
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install" "@angular/cli"
npm ERR! node v6.11.3
npm ERR! npm v3.10.10

npm ERR! tarball.destroy is not a function
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! github
[email protected] D:\Project\kontakti
`-- @angular/[email protected]

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN [email protected] No description
npm WARN [email protected] No repository field.
npm ERR! Windows_NT 10.0.15063
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install" "@angular/cli"
npm ERR! node v6.11.3
npm ERR! npm v3.10.10

npm ERR! Callback called more than once.
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! github

npm ERR! Please include the following file with any support request:
npm ERR! D:\Project\kontakti\npm-debug.log


Solution 1:[1]

For these versions:

node --version = v6.11.3

npm --version = 3.10.10

You Should try Angular CLI 4

$npm install -g @angular/[email protected]

Solution 2:[2]

To use the ng command in the terminal, you need to install Angular CLI globally.

Run this command to install : npm install -g @angular/cli.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Samuel Liew
Solution 2 Anish B.