galaxyproject / cloudlaunch-ui

A user interface for the cloudlaunch app
MIT License
8 stars 13 forks source link

`ng serve` Error: Version of @angular/compiler-cli needs to be 2.3.1 or greater. Current version is "undefined". #8

Closed machristie closed 6 years ago

machristie commented 7 years ago

Running ng serve fails with the following error

Version of @angular/compiler-cli needs to be 2.3.1 or greater. Current version is "undefined".
Error: Version of @angular/compiler-cli needs to be 2.3.1 or greater. Current version is "undefined".
    at Object.<anonymous> (/Users/machrist/SGCI/cloudlaunch/cloudlaunch-ui/node_modules/@ngtools/webpack/src/index.js:27:11)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/machrist/SGCI/cloudlaunch/cloudlaunch-ui/node_modules/angular-cli/models/webpack-build-typescript.js:5:17)
...

It would appear to be this bug: https://github.com/angular/angular-cli/issues/5558

Attempting to pin @ngtools/webpack to earlier version as mentioned in issue

npm install --save-dev @ngtools/webpack@1.1.2
npm install

Now ng serve works and I can connect to http://localhost:4200

I'll create a pull request with my changes.

nuwang commented 7 years ago

@machristie Thanks for the fix.

machristie commented 6 years ago

Even after the fix, I still need to run the following two commands before npm start will work. I have no idea why.

npm install --save-dev @ngtools/webpack@1.1.2
npm install

Just noting that this is still an issue. Once we move to Angular 4 this will probably resolve itself.

afgane commented 6 years ago

What versions of node and npm do you have installed?

machristie commented 6 years ago

@afgane

(venv) BL-UITS-RTLT021:cloudbridge machrist$ node --version
v6.9.4
(venv) BL-UITS-RTLT021:cloudbridge machrist$ npm --version
5.3.0
afgane commented 6 years ago

Fixed with 48bff9fb5242d4c2a5574b71866376d3b8956971