How to ng serve an older Angular project?


How to ng serve an older Angular project?



I'm trying to ng serve a sample Angular project included in a third party framework. The sample project is wanting Angular v~4 judging from its package.json file. My global CLI version is 6.0.8. The project doesn't include a node_modules folder nor an angular-cli.json or angular.json file.


ng serve


package.json


node_modules


angular-cli.json


angular.json



How can I successfully ng serve this older project?


ng serve



Must I meddle with this project's package.json file to update the version numbers, or can I instead just install the older version ~4.0.3 of local Angular CLI?


package.json



And even then, once I install an older CLI version, how do I generate the angular-cli.json file via the CLI? So far I'm only able to get node_modules to appear - not an angular-cli.json or angular.json file.


angular-cli.json


node_modules


angular-cli.json


angular.json





ng new MyProjectName generates a new Angular app with a basic angular.json that you could use
– user184994
Jul 2 at 20:38


ng new MyProjectName





Try running ng update @angular/cli and see if that repairs the issue.
– R. Richards
Jul 2 at 20:43


ng update @angular/cli





Projects (should) never include a node_modules/ folder, that's what npm and package.json are for.
– msanford
Jul 3 at 13:39



node_modules/


npm


package.json




1 Answer
1



It may be a silly question but did you use npm install after getting the project to install the dependencies?


npm install



Only after that will appear the folder node_modules.


node_modules






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

api-platform.com Unable to generate an IRI for the item of type

PHP contact form sending but not receiving emails

Do graphics cards have individual ID by which single devices can be distinguished?