Skip to content

Angular Cli Errors with nodejs 5.5.0 #4604

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ahmed-musallam opened this issue Feb 10, 2017 · 7 comments
Closed

Angular Cli Errors with nodejs 5.5.0 #4604

ahmed-musallam opened this issue Feb 10, 2017 · 7 comments

Comments

@ahmed-musallam
Copy link

ahmed-musallam commented Feb 10, 2017

Please provide us with the following information:

OS?

Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)
Mac OSX sierra and Jenkins CentOS 5

Versions.

Please run ng --version. If there's nothing outputted, please run in a Terminal: node --version and paste the result here:
beta.31

Repro steps.

Was this an app that wasn't created using the CLI? What change did you do on your code? etc.

The log given by the failure.

Normally this include a stack trace and some more information.

  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:16:19)
    at Object.<anonymous> (/usr/local/lib/node_modules/@angular/cli/node_modules/@ngtools/json-schema/src/index.js:2:30)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)

Also this:

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:16:19)
    at Object.<anonymous> (/data4/hudson/workspace/ui.resources/node_modules/@angular/cli/models/config.js:2:18)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)

Mention any other details that might be useful.

Yesterday @ngtools/[email protected] was updated to 1.0.3 and also @ngtools/[email protected] was updated to 1.2.9

Seems like those two updates introduces ES2016 syntax that Node 5.5.0 does not like.
I know angular cli team did their due diligence and mentioned that node < 6.9 will no longer be supported... BUT, it would have been nice if you could at least pin the versions

Those two releases mentioned above, should have been minor releases.
Additionally, @angular/[email protected] should have had the following dependencies:
"@ngtools/json-schema":"1.0.x" instead of "^1.0.0"
and "@ngtools/webpack":"1.2.x" instead of "^1.2.3"

I appreciate all the hard work from angular team. I am not aware of your development process but s an outsider, that's what I think.

I found a solution to this, please find it it in the comments


Thanks! We'll be in touch soon.

@ahmed-musallam
Copy link
Author

ahmed-musallam commented Feb 10, 2017

OBVIOUSLY, the best solution would be to update to the supported Node 6.9 but in my case, it was out of my hand

The solution that fixed those issues for me on node 5.5.0 was npm shrinkwrap
Basically, we want to make sure we get the versions of @ngtools/webpack and @ngtools/json-schema that work in node 5.5.0

here is the solution

rm -rf node_modules  #remove all installed modules

npm install #install al modules back

npm remove @ngtools/webpack
npm install @ngtools/[email protected] # install the specific version that works with node 5.5.0

npm remove @ngtools/json-schema
npm install @ngtools/[email protected] # install the specific version that works with node 5.5.0

npm shrinkwrap --dev  #if it throws errors about extraneous dependencies, use npm prune 

a new npm-shrinkwrap.json file is generated and will guarantee that you get the specified versions above

read more about srinkwrap here

@RichardSilveira
Copy link

+1

@hansl
Copy link
Contributor

hansl commented Feb 10, 2017

We do not support Node version before 6.9. The Beta 28.3 was the last version to support Node 4 and 5.

@hansl hansl closed this as completed Feb 10, 2017
@ahmed-musallam
Copy link
Author

@hansl from the CHANGELOG.md for beta 28:

angular-cli: Node < 6.9 will be deprecated soon, and this will show a warning to users. Moving forward, that warning will be moved to an error with the next release.

I saw the warning, but there was NO error that told me that you don't support Node version before 6.9. according to above, I expected an error that breaks the build and mentions that it wont work because of node version...

@RichardSilveira
Copy link

RichardSilveira commented Feb 10, 2017

So, this error is happening in my build server and local machine, both with node 5.5. My app it's using the version beta-19 of angular-cli, and updating my local machine and my build server to node 6.9.5, everything is working fine...

@ubarevicius
Copy link

Our build server also fails with beta.28.3, probably [email protected] and [email protected] are not locked and install more recent version automatically on build that go through npm install steps. I would still see this as an issue, if beta.28.3 is the last version which should work on node 5... We will ask admins to update the node version on the build server, but I completely understand that sometimes it's not possible.

acidjames added a commit to acidjames/angular-cli that referenced this issue Feb 13, 2017
Hi,

Isn't this line making angular cli installable even if node version is not supported ? ("node": ">= 6.9.0",)

ref: angular#4604
filipesilva pushed a commit that referenced this issue Feb 14, 2017
Hi,

Isn't this line making angular cli installable even if node version is not supported ? ("node": ">= 6.9.0",)

ref: #4604
asnowwolf pushed a commit to asnowwolf/angular-cli that referenced this issue Apr 12, 2017
Hi,

Isn't this line making angular cli installable even if node version is not supported ? ("node": ">= 6.9.0",)

ref: angular#4604
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants