1

I would like to post a basik Angular code to Codeship then heroku. But I have a problem what i can't solve. I got this error. I searched, i found a that node version is too old, but my node version in my computer is the newest 6.11.0, npm 3.10.10.

    {
  "name": "anonymous",
  "version": "0.0.0",
  "license": "MIT",
  "scripts": {
    "ng": "ng",
    "start": "http-server dist -p $PORT",
    "build": "ng build",
    "test": "ng test --single-run",
    "lint": "ng lint",
    "e2e": "ng e2e",
    "postinstall": "ng build --aot -prod"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^4.0.0",
    "@angular/cli": "1.1.1",
    "@angular/common": "^4.0.0",
    "@angular/compiler": "^4.0.0",
    "@angular/compiler-cli": "^4.0.0",
    "@angular/core": "^4.0.0",
    "@angular/forms": "^4.0.0",
    "@angular/http": "^4.0.0",
    "@angular/platform-browser": "^4.0.0",
    "@angular/platform-browser-dynamic": "^4.0.0",
    "@angular/router": "^4.0.0",
    "core-js": "^2.4.1",
    "http-server": "^0.10.0",
    "node-wget": "^0.4.2",
    "rxjs": "^5.1.0",
    "wget": "0.0.1",
    "zone.js": "^0.8.4"
  },
  "devDependencies": {
    "@angular/language-service": "^4.2.1",
    "@types/jasmine": "2.5.45",
    "@types/node": "~6.0.60",
    "codelyzer": "~3.0.1",
    "jasmine-core": "~2.6.2",
    "jasmine-spec-reporter": "~4.1.0",
    "karma": "~1.7.0",
    "karma-chrome-launcher": "~2.1.1",
    "karma-cli": "~1.0.1",
    "karma-coverage-istanbul-reporter": "^1.2.1",
    "karma-jasmine": "~1.1.0",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "~5.1.2",
    "ts-node": "~3.0.4",
    "tslint": "~5.3.2",
    "typescript": "~2.3.3"
  }
}

I don't know where to set node version in an angular project.

Dóczi Szilárd
  • 366
  • 1
  • 2
  • 14

1 Answers1

2

You are seeing this error because the version of Node used by your Codeship build server is too old. As per your error message it is currently using version v0.10.48.

You need to update the Node Version as part of the CodeShip deployment.

Assuming you are using a custom script, you need the following line to it.

#Update node to version 6.11.0
nvm install 6.11.0

Note that you need Node 4.1 or later for the Angular CLI.

Kildareflare
  • 4,590
  • 5
  • 51
  • 65