5

I am trying to create a project (named ngadmin) via the angular cli but it throws errors on this command: ng new ngadmin. The errors are:

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.

I am not sure what the problem is as this cli was working fine for me a few days ago.

11 Answers 11

7

Check in your username folder, if there is package.json and node_module exist. If they are there then delete them.

Notice: you may have created an angular project in your home/username directory. If you delete them it will work.

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

Comments

7

If using Linux, go to home and delete package.json.

Comments

3

I had this problem as well. Here is how I fixed it:

  • Go to package.json
  • Under "Dependencies", find "angular-cli": "^1.0.0-beta.18"
  • Delete this line ("angular-cli": "^1.0.0-beta.18")
  • Save file

Hope that helps!

Comments

2

The first warning regarding graceful-fs is due to the fact that angular-cli uses older version of graceful-fs pkg, nothing to worry about that.

The error "You cannot use the new command inside an angular-cli project" signifies you are inside an angular cli project, get out of the angular cli project using cd .. command and try running the command ng new ngadmin it will work.

1 Comment

Hey, yup i had tried that, i tried to create the project in multiple locations on my pc including right on the c drive. always got the same error
1

there is a file package.json

Simply remove it and then Create project. it will work for sure

Comments

0

Seems like i fixed my problem. I have no idea what happened but i noticed system32 was not in my PATH so i added that and uninstalled and reinstalled the angular-cli package. everything works like a charm now

Comments

0

I had the same issue, the thing was I was not closely following along the tutorial I was watching and I tried using the same directory, I used cd .. to move up in the file structure and it worked like a charm, hope this helps! enter image description here

Comments

0

i had the same problem today, I started a fresh project and did

 npm install -save @angular/cli

and received the error. I just renamed the package.json to .json2 temporarily and it worked.

Comments

0

Delete the file package.json in current directory where you are trying to create. Then try to install again.

Comments

0

In windows cd/User,Find the package.json,package-lock.json file and delete both the files.

Restart your command prompt and you are ready to go.And try to use this command

npm install --save-dev @angular/cli@latest

Comments

-1

You must have used local "npm install @angular/cli" command to install angular locally in your project.

Uninstall local angular using "npm uninstall @angular/cli" install angular globally using "npm install -g @angular/cli"

and then try "ng new ngadmin"

Because "ng new projectName" will automatically install angular/cli locally as a dev-dependency

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.