The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

felix (7) [Avatar] Offline
#1
Hi,

chapter one was a good read, but I got stuck in chapter 2 'Setting up the project'.

Execution of
sudo npm install -g @angular/cli
gives me this error:

npm WARN optional Skipping failed optional dependency /@angular/cli/chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.1.1


npm version
gives me this:


{ npm: '3.8.6',
ares: '1.10.1-DEV',
http_parser: '2.7.0',
icu: '56.1',
modules: '47',
node: '5.12.0',
openssl: '1.0.2h',
uv: '1.8.0',
v8: '4.6.85.32',
zlib: '1.2.8' }


Any hints?

thanks,
felix
felix (7) [Avatar] Offline
#2
Ok, it seems that the warning is not critical. 'ng' is installed, but when I execute
ng new stocks
I get this error:

/usr/lib/node_modules/angular-cli/node_modules/@ngtools/json-schema/src/schema-class-factory.js:48
constructor(schema, value, ...fallbacks) {
^^^

SyntaxError: Unexpected token ...
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:387:25)
at Object.Module._extensions..js (module.js:422:10)
at Module.load (module.js:357:32)
at Function.Module._load (module.js:314:12)
at Module.require (module.js:367:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/usr/lib/node_modules/angular-cli/node_modules/@ngtools/json-schema/src/index.js:3:30)
at Module._compile (module.js:413:34)
at Object.Module._extensions..js (module.js:422:10)



Help is greatly appreciated!

f.
felix (7) [Avatar] Offline
#3
Ok, an upgrade to nodejs 6.9 fixed the issue (instructions at https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-ubuntu-16-04)
jeremy.wilken (208) [Avatar] Offline
#4
Yes, the CLI has changed a lot in the past couple weeks since I wrote the book, but you will need Node 6.9 (the current LTS) or greater to run the latest CLI (because it uses ES6 capabilities that weren't in earlier releases).

Hope this helps others as well until the next release where I can hopefully get these details updated!