3

How can I get the Angular 4 starter? We have developed multiple SPAs on Angular 4 and want to stay consistent throughout. ng new angular-sample --ng4

makes angular 5 application.

 "dependencies": {
    "@angular/animations": "^5.0.0",
    "@angular/common": "^5.0.0",
    "@angular/compiler": "^5.0.0",
    "@angular/core": "^5.0.0",
    "@angular/forms": "^5.0.0",
    "@angular/http": "^5.0.0",
    "@angular/platform-browser": "^5.0.0",
    "@angular/platform-browser-dynamic": "^5.0.0",
    "@angular/router": "^5.0.0",
    "core-js": "^2.4.1",
    "rxjs": "^5.5.2",
    "zone.js": "^0.8.14"
  },

6 Answers 6

2

you need to set your angular-cli version to 1.4.6. Follow these steps.

npm uninstall -g angular-cli npm cache clean npm install -g [email protected]

If you install angular cli recently then cli name might be "angular/cli". For that you can use following command.

npm uninstall -g angular/cli npm cache clean npm install -g [email protected]

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

Comments

1

I think you need to use Angular CLI version 1.4.6 if you want to build Angular version 4 Projects out of the box.

More on the same

Comments

0

You can not generate ng4 app from latest angular cli. --ng4 option has now been removed as the latest.

CLI will now create an Angular 5 project just by using ng new project_name and you can set angular version as below package.json:

  "dependencies": {
    "@angular/common": ">=4.0.0-beta <5.0.0",
    "@angular/compiler": ">=4.0.0-beta <5.0.0",
    "@angular/core": ">=4.0.0-beta <5.0.0",
    "@angular/forms": ">=4.0.0-beta <5.0.0",
    "@angular/http": ">=4.0.0-beta <5.0.0",
    "@angular/platform-browser": ">=4.0.0-beta <5.0.0",
    "@angular/platform-browser-dynamic": ">=4.0.0-beta <5.0.0",
    "@angular/router": ">=4.0.0-beta <5.0.0",
    ...

Just tried it, and it works.

Update to ng5 as soon as possible.

Comments

0

Always use latest angular cli version when updation needed

npm install -g npm

then

npm cache clean
npm install -g @angular/cli@latest

then

 "dependencies": {
    "@angular/animations": "^5.0.0",
    "@angular/common": "^5.0.0",
    "@angular/compiler": "^5.0.0",
    "@angular/core": "^5.0.0",
    "@angular/forms": "^5.0.0",
    "@angular/http": "^5.0.0",
    "@angular/platform-browser": "^5.0.0",
    "@angular/platform-browser-dynamic": "^5.0.0",
    "@angular/router": "^5.0.0",
    "core-js": "^2.4.1",
    "rxjs": "^5.5.2",
    "zone.js": "^0.8.14"
  }

now use,

npm install

if any error regarding deprecation then update your code as latest updation

Comments

0

You can get git pull of the starter repo build on NG5

[https://github.com/blazehub/ng-cli-starter.git]

The project is pre-structured with base components to start with.

If you get any errors while npm install, simply upgrade your global cli to cli version in package.json.

Comments

0

You can create angular project using angular-cli but which of version of angular you want to use that's your wish with help of specifying version in package.json. but its better to go with latest version of angular always, i don't see much breaking difference between angular 4 and angular 5 we have some deprecation's, we can address them easily

 "dependencies": {
    "@angular/animations": "^4.2.4",
    "@angular/common": "^4.2.4",
    "@angular/compiler": "^4.2.4",
    "@angular/core": "^4.2.4",
    "@angular/forms": "^4.2.4",
    "@angular/http": "^4.2.4",
    "@angular/platform-browser": "^4.2.4",
    "@angular/platform-browser-dynamic": "^4.2.4",
    "@angular/router": "^4.2.4",
    "core-js": "^2.4.1",
    "rxjs": "^5.5.2",
    "zone.js": "^0.8.14"
  }

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.