Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

164
Views
Create Project with Angular 4 Release using Angular CLI

How do I create new project with the latest Angular 4 release using Angular CLI with the command below :

ng new new_project

I have the following versions installed

 - @angular/cli: 1.0.0-rc.2
 - node: 7.7.3
 - npm: 4.4.1
about 4 years ago · Santiago Trujillo
3 answers
Answer question

0

You cannot create a new Angular application with the CLI that uses Angular 4 out of the box. At least, not at the moment. Only Angular 2 is supported by the CLI, at this time. I imagine that will change soon enough.

However, you can create a new application using ng new <app-name>, and then change the version of Angular it uses in the package.json. Run npm install, and it should all work. That has been my experience.

Hope this helps you out.

UPDATE:

I am mistaken! There is an option that you can pass to the ng new command that will set up the project to use ng 4.

ng new project_new --ng4

From ng --help:

--ng4 (Boolean) (Default: false) Create a project with Angular 4 in the template.

Right now this sets up the @angular section package.json as follows.

  "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 2

The --ng4 option has now been removed as the latest CLI will now create an Angular 5 project just by using ng new project_name.

about 4 years ago · Santiago Trujillo Report

0

The easiest way to create an Angular 4 project using Angular CLI is install an older version of the @angular/cli (1.4.10)

npx @angular/cli@1.4.10 new myangular4

(thanks Explosion Pills)

Or

> npm remove -g @angular/cli
> npm install -g @angular/cli@1.4.10
> ng --version
  @angular/cli: 1.4.10
> ng new myangular4

Creates a myangular4/package.json

{
  "name": "myangular4",
  "version": "0.0.0",
  "license": "MIT",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "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.4.2",
    "zone.js": "^0.8.14"
  },
about 4 years ago · Santiago Trujillo Report

0

To create an Angular_4 project using Angular CLI follow these commands lines :

npm remove -g @angular/cli

npm install -g @angular/cli@1.4.10

ng new myNewAngular4App

about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!