I renamed my Angular 4 project folder from auction-life to auction-05-life and replaced 3 occurrences of the old project name in:
I then ran ng serve
and got this:
You seem to not be depending on "@angular/core". This is an error.
Edit: Following the instructions in the comments below, I restarted the terminal window, ensured I was in the correct project folder auction-05-life, ran npm install
then ng serve
and this time got a different exception:
module.js:471 throw err; ^ Error: Cannot find module 'heimdalljs-logger' at Function.Module._resolveFilename (module.js:469:15) at Function.Module._load (module.js:417:25) ...
Search in your project wherever the old name is used. In Visual Studio Code search can be done by using the search bar provided. Replace old name with your new name. Rename the project folder name as well and you are done.
Renaming Projects Right-click the root folder of your project and select Refactor | Rename from the context menu or press Shift+F6 . In the dialog that opens, choose the rename strategy. If the project name is the same as the name of its root folder, select Rename directory.
Right click the namespace → Rename.... This should search and replace all references to your namespace throughout the project. Close the project → rename the project folder.
Use 'Rename Symbol' command With the cursor at the Component class, open Command Palette in VSCode with cmd+shift+p . Select “Rename Symbol” command and change the class name. VSCode will change the class name, and update all the references to this class in other files.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With