joannbrereton / rpi3-angular2-quickstart

Dockerfile for Angular2 Quickstart on Raspberry Pi 3 (ARM)
1 stars 0 forks source link

Wrong nodejs version installed #2

Open michelepagot opened 6 years ago

michelepagot commented 6 years ago

installed version in the image is:

root@c5ad3162ed36:~/quickstart# node --version
v4.5.0
root@c5ad3162ed36:~/quickstart# npm --version
4.0.5

but https://www.npmjs.com/package/@angular/cli Prerequisite section explain that

Prerequisites Both the CLI and generated project have dependencies that require Node 6.9.0 or higher, together with NPM 3 or higher.

It result in a failure in first step of https://angular.io/tutorial/toh-pt0

root@c5ad3162ed36:~/quickstart# ng new angular-tour-of-heroes
/usr/local/lib/node_modules/@angular/cli/models/config/config.js:17
    constructor(_configPath, schema, configJson, fallbacks = []) {
                                                           ^

SyntaxError: Unexpected token =
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:373:25)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/usr/local/lib/node_modules/@angular/cli/models/config.js:3:18)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)

As also explained here

joannbrereton commented 6 years ago

To be honest it's been ages since I did this, but I'll have a look this weekend to see if I can get around the error.