0

Update:

Okay It seccussfully installed "npm install -g angular-cli" but now I got new error: "You cannot use the new command inside an angular-cli project." while trying to do: "ng new ang2pro" for making a new project.

C:\Users\armyTik\Desktop\angular2_projects\1>ng new pro-name
(node:6512) fs: re-evaluating native module sources is not supported. If you are using
 the graceful-fs module, please update it to a more recent version.
You cannot use the new command inside an angular-cli project.

Original post:

It was working just fine yestarday and now I get the following errors even after reinstalling nodejs:

(The cmd is open with administrator privileges) the cmd is open with administrator privileges

Stav Alfi
  • 13,139
  • 23
  • 99
  • 171
  • is this error occurs only while installing `angular-cli` package or for all packages. It clearly says there is some problem with your `global` directory path. – Venkata Dorisala Jul 07 '16 at 13:45
  • http://stackoverflow.com/questions/19874582/change-default-global-installation-directory-for-node-js-modules-in-windows – Venkata Dorisala Jul 07 '16 at 13:46
  • The only steps I did is to create an empty folder and run inside 'npm install -g angular-cli'. – Stav Alfi Jul 07 '16 at 13:49
  • can you try instlalling other packages. like `npm install -g jquery` – Venkata Dorisala Jul 07 '16 at 13:51
  • also you don't have to go to empty directory to run this command. You can run it anywhere. It just installs the packages in the `global` path configured. Default is `C:\AppData\Roaming\npm\node_modules\` – Venkata Dorisala Jul 07 '16 at 13:52
  • 'npm install -g jquery' installed! Anyways while installing npm install -g angular-cli , It says during installtion: "still install loadAllDepsIntoIdealTree". Is this the reason for the problem? – Stav Alfi Jul 07 '16 at 13:57
  • The `angular-cli` documentation talks about some `prerequisites : Node 4 or greater, Typings V1 or greater` . Make sure you have these installed already. https://github.com/angular/angular-cli#prerequisites – Venkata Dorisala Jul 07 '16 at 14:01
  • Okay It seccussfully installed "npm install -g angular-cli" but now I got new error: "You cannot use the new command inside an angular-cli project." while trying to do: "ng new ang2pro" for making a new project. – Stav Alfi Jul 07 '16 at 14:05
  • when did u get this error? after installing angular-cli ? or during? – Venkata Dorisala Jul 07 '16 at 14:08
  • after installinh -g angular-cli , I tryied to make new project by doing: "ng new project-name" and it failed with this error: "You cannot use the new command inside an angular-cli project.". – Stav Alfi Jul 07 '16 at 14:10
  • i think you need to run `ng new project-name` command from the root directory. Not inside the angular directory. – Venkata Dorisala Jul 07 '16 at 14:13
  • many thanks for your help but this problem has not been solved yet. :( – Stav Alfi Jul 07 '16 at 14:19
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/116708/discussion-between-venky-and-stav-alfi). – Venkata Dorisala Jul 07 '16 at 14:21
  • This is similar to [this question](https://stackoverflow.com/a/53817506/4657538) – Vignesh Dec 17 '18 at 14:48

2 Answers2

0

Make sure you have prerequisites installed on your machine.

angular-cli needs Node 4 or above & Typings V1 or greater

node -v should be greater than 4

node typings -v should be greater than 1

otherwise install typings using npm install typings -g

Venkata Dorisala
  • 4,783
  • 7
  • 49
  • 90
0

If you are on a mac don't forget sudo in front of the command

DanPride
  • 150
  • 11