1

I just renamed the folder that contains an angular project. But when running ng serve, I got the error:

You seem to not be depending on “@angular/core”. This is an error

I am executing the command ng serve inside the correct folder. So this issue is not the same one mentioned here. And I already ran npm install.

Additionally, the command npm link causes the error:

npm ERR! Package must have a name field to be linked

R. Richards
  • 24,603
  • 10
  • 64
  • 64
Muhammad Altabba
  • 2,583
  • 19
  • 31

1 Answers1

0

The project name is saved in multiple files that have to be updated after renaming the folder. To find all those files search in the directory inside all files for your old-project-name and update all the occurrences. The most important places are in the following to files:

File: .angular-cli.json

{
    "project": {
        "name": "update-it-to-folde-name"
    }
...
}

File: package.json

{
  "name": "update-it-to-folde-name"
...
}
Muhammad Altabba
  • 2,583
  • 19
  • 31