Skip to content
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

Syntax error when using version 10.2.9 #170

Closed
ayelkawar2 opened this issue Dec 2, 2016 · 40 comments
Closed

Syntax error when using version 10.2.9 #170

ayelkawar2 opened this issue Dec 2, 2016 · 40 comments

Comments

@ayelkawar2
Copy link

ayelkawar2 commented Dec 2, 2016

After updating to the newest version, I get the following error on running 'webdriver-manager' command.

C:\Users\(user)\AppData\Roaming\npm\node_modules\webdriver-manager\built\lib\cli\logger.js:66
info(...msgs) {
^^^
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. (C:\Users\(user)\AppData\Roaming\npm\node_modules\we
bdriver-manager\built\lib\cli\index.js:8:10)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)

@bathos
Copy link

bathos commented Dec 2, 2016

This commit changed the build target from ES5 to ES6, effectively dropping support for node 4. This was recognized — it’s mentioned in the changelog ("with node 6 on LTS, we can update the tsconfig to es6") and the test config was changed to remove node 4. While I don’t see an explicit statement about what versions of Node are intended to be supported, the fact that up until that point it had been tested against 4 seems to imply that node 4 was supported, prior to 10.2.9.

I think it may be a mistake that this was a patch bump.

@wswebcreation
Copy link

Is the versioning of webdriver-manager still correct? In my opinion this is a breaking change and not a fix, so shouldn't the version be bumped to at least 10.3.x, or even 11.x.x?
Our complete buildstreet, that currently still runs on Docker with Node 4.5, fails.

@axelssonHakan
Copy link

We are experiencing the same
This is definitely a breaking change

@aszwaj
Copy link

aszwaj commented Dec 2, 2016

Same issue on my CI. I think that version 10.2.10 which roll back the node 4 removal would be quite helpful.

@szikszail
Copy link

I agree, please create a release with roll back to node 4 support.

@wswebcreation
Copy link

Temp fixes could be:

  • use npm shrinkwrap to set the version of webdriver-manager
  • or if that won't work, do the following

for those who use node 4.5. This will first wait during the npm install if protractor is loaded, if so, then downgrade to webdriver-manager@10.2.8

create a file (webdriver.manager.fix.js) in your root and add this

'use strict';

const child_process = require('child_process');

(function protractorLoaded(){
    try{
        const protractor = require.resolve('protractor');
        console.log('Downgrade webdriver-manager to 10.2.8');
        child_process.execSync('cd ./node_modules/protractor && npm install webdriver-manager@10.2.8');
    }
    catch(e) {
        console.log('protractor, try again after 500 miliseconds');
        setTimeout(protractorLoaded, 500)
    }
})();

and add this in your package.json

"scripts":{
    "postinstall": "node ./webdriver.manager.fix.js"
}

@cnishina
Copy link
Member

cnishina commented Dec 2, 2016

I'll roll this back tomorrow. Sorry about that... I'll do a release with fixes and try to get around the spread syntax issue with node 4. You could shrink wrap your webdriver-manager if you want or just wait for the fix tomorrow.

Node 6 is in LTS and we'll be moving forward with that soon.

@cnishina
Copy link
Member

cnishina commented Dec 2, 2016

I think what I'll do is unpublish package 10.2.9. Simply deprecating the change in npm appears that it would still install 10.2.9. Rolling back the change to 10.2.8 and publishing it again to the latest 10.2.10 feels wrong.

So unpublishing will leave the latest hot fix as 10.2.8 and I'll publish these changes with 11.0.0. (Keeping with semantic versioning).

  • unpublish from npm
  • remove tag 10.2.9
  • publish 11.0.0 with adequate changelog info on the breaking change.

@wswebcreation
Copy link

@cnishina
Sounds good

@cnishina
Copy link
Member

cnishina commented Dec 2, 2016

npm view webdriver-manager

  versions:
   [ '0.0.1',
     '0.0.2',
     '0.0.3',
     '0.0.4',
     '0.0.5',
     '0.0.6',
     '0.0.7',
     '0.0.8',
     '1.0.0',
     '1.0.1',
     '2.0.0',
     '3.0.0',
     '4.0.0',
     '5.0.0',
     '5.1.0',
     '5.2.0',
     '6.0.0',
     '6.0.2',
     '7.0.0',
     '7.0.1',
     '8.0.0',
     '9.0.0',
     '10.0.0',
     '10.0.1',
     '10.0.2',
     '10.0.3',
     '10.0.4',
     '10.1.0',
     '10.2.0',
     '10.2.1',
     '10.2.2',
     '10.2.3',
     '10.2.4',
     '10.2.5',
     '10.2.6',
     '10.2.7',
     '10.2.8',
     '11.0.0-beta.0' ],

@wswebcreation
Copy link

Very nice and very quick!!

@cnishina
Copy link
Member

cnishina commented Dec 2, 2016

Huzzah. Done!

Sorry about that everyone...I end up switching node versions with nvm so often that I forget that upgrading node is a breaking change.

@wswebcreation
Copy link

@cnishina

Shit happens ;-). Again tnx for fixing this very fast!

@wswebcreation
Copy link

@cnishina

I'm still seeing 10.2.9 in the version list
npm view webdriver-manager

 versions:
   [ '0.0.1',
     '0.0.2',
     '0.0.3',
     '0.0.4',
     '0.0.5',
     '0.0.6',
     '0.0.7',
     '0.0.8',
     '1.0.0',
     '1.0.1',
     '2.0.0',
     '3.0.0',
     '4.0.0',
     '5.0.0',
     '5.1.0',
     '5.2.0',
     '6.0.0',
     '6.0.2',
     '7.0.0',
     '7.0.1',
     '8.0.0',
     '9.0.0',
     '10.0.0',
     '10.0.1',
     '10.0.2',
     '10.0.3',
     '10.0.4',
     '10.1.0',
     '10.2.0',
     '10.2.1',
     '10.2.2',
     '10.2.3',
     '10.2.4',
     '10.2.5',
     '10.2.6',
     '10.2.7',
     '10.2.8',
     '10.2.9',
     '11.0.0-beta.0' ]

@cnishina
Copy link
Member

cnishina commented Dec 2, 2016

Leaving this open so people encountering the same issue will see it.

@cnishina cnishina reopened this Dec 2, 2016
@cnishina cnishina changed the title Syntax error when using version 10.2.9 [resolved] Syntax error when using version 10.2.9 Dec 2, 2016
@cnishina
Copy link
Member

cnishina commented Dec 2, 2016

Hello! Webdriver-manager 10.2.9 was published earlier today and it was causing problems because it requires node 6. To resolve this problem, I unpublished 10.2.9. What this means is that you'll just need to remove the node_module for webdriver-manager and do a fresh npm install.

Version 11.0.0 was published after that with notes on breaking change for node 6.

@cnishina cnishina changed the title [resolved] Syntax error when using version 10.2.9 Syntax error when using version 10.2.9 Dec 2, 2016
@cnishina
Copy link
Member

cnishina commented Dec 2, 2016

Will close this issue next week.

@wswebcreation
Copy link

But 10.2.9 is still in NPM, I thought you removed it

@cnishina
Copy link
Member

cnishina commented Dec 2, 2016

10.2.9 has been removed.

npm i -g webdriver-manager@~10.2.7
/Users/cnishina/.nvm/versions/node/v6.9.1/bin/webdriver-manager -> /Users/cnishina/.nvm/versions/node/v6.9.1/lib/node_modules/webdriver-manager/bin/webdriver-manager
/Users/cnishina/.nvm/versions/node/v6.9.1/lib
└── webdriver-manager@10.2.8

@cnishina
Copy link
Member

cnishina commented Dec 2, 2016

Also, created a stackoverflow that references this issue.

@cnishina
Copy link
Member

cnishina commented Dec 2, 2016

@wswebcreation is it possibly cached? You could potentially delete the cached version ~/.npm/webdriver-manager/10.2.9.

@wswebcreation
Copy link

It was not cached, the log I pasted was from the npm command, before is wasn't showing. I'll do a fresh install now on my local machine (new install of project en modules). If you hear nothing it's fixed ;-)

@cnishina
Copy link
Member

cnishina commented Dec 2, 2016

Alright, well I'm headed to bed so fingers crossed!

@wswebcreation
Copy link

wswebcreation commented Dec 2, 2016

It's running now!
Good night!

@huerlisi
Copy link

huerlisi commented Dec 2, 2016

Thanks for the quick fix. There's some issues for people using caching layers like Artifactory though. It's not so simple to delete releases there and it might even be prohibited by legal requirements (Entreprise problems;-).

So when using a proper semantic versioned dependency like ^10.2.8 it will keep failing when using an older node version. Specifying a specific version (10.2.8) would work, but might not be want people want.

And it's even trickier: packages like protractor are using such a semantic version, so it's impossible to ensure 10.2.9 won't be used (without using shrinkwrap).

So I propose to re-release a version 10.2.10, reverting the change, including an updated changelog.

@cnishina
Copy link
Member

cnishina commented Dec 2, 2016

@huerlisi I did think about Artifactory last night and was hoping no one had that problem. I'll cut a release for 10.2.8 to be 10.2.10 and update the changelog.

@cnishina
Copy link
Member

cnishina commented Dec 2, 2016

Quick update. 10.2.10 has been released to resolve caching layers like Artifactory w/ an updated changelog. Thanks @huerlisi.

@tomreece
Copy link

tomreece commented Dec 2, 2016

Node/npm/overall noob and dummy here... why would anyone ever pull down a version of something instead of releasing a new version that reverts or fixes the issue? Do you force push to change history in your git branches too?

@cnishina
Copy link
Member

cnishina commented Dec 2, 2016

@tomreece It was late last night and made a decision. That decision although was not probably the right decision, I later released a new version with the reverted change.

In regards to your comment about force pushing changes, the master branch does not allow force pushing so I just added another commit with some updates on the changelog. I hope that helps.

@huerlisi
Copy link

huerlisi commented Dec 2, 2016

@cnishina your fast response is very much appreciated!

@cnishina
Copy link
Member

cnishina commented Dec 8, 2016

It's been a week. Closing this issue!

@cnishina cnishina closed this as completed Dec 8, 2016
sjelin pushed a commit to sjelin/webdriver-manager that referenced this issue Dec 16, 2016
- version 10.2.9 unpublished from npm and tag removed from github
  due to breaking change with requiring node 6 LTS

closes angular#170
sjelin pushed a commit to sjelin/webdriver-manager that referenced this issue Dec 16, 2016
- version 10.2.9 unpublished from npm and tag removed from github
  due to breaking change with requiring node 6 LTS

closes angular#170
sjelin pushed a commit to sjelin/webdriver-manager that referenced this issue Dec 20, 2016
- version 10.2.9 unpublished from npm and tag removed from github
  due to breaking change with requiring node 6 LTS

closes angular#170
sjelin pushed a commit to sjelin/webdriver-manager that referenced this issue Dec 20, 2016
- version 10.2.9 unpublished from npm and tag removed from github
  due to breaking change with requiring node 6 LTS

closes angular#170
@twolfson
Copy link

twolfson commented Jan 7, 2017

This is still broken for Node.js@4.x.x. I don't understand why support for 4.x.x was dropped when it's still in active LTS until 2017-04-01 (3 months left) and being maintained until 2018-04-01 (15 months left) =/

https://github.com/nodejs/LTS/tree/772147f5d1493a13851084dd8f262352c64e5fbd

@KakadeVrushali
Copy link

I am still facing this issue.
webdriver-manager version is 11.1.1
node version is 6.5.0

Please suggest the solution

@wswebcreation
Copy link

@KakadeVrushali

Have you tried updating to node > 7 with NVM?

@KakadeVrushali
Copy link

Yes I have also tried with node v7.4.0 but faced same problem

@wswebcreation
Copy link

@KakadeVrushali

image

image

This is my setup and I don't have the problem.

@jamshid
Copy link

jamshid commented Jan 20, 2017

Are you really saying the current version of node and npm in ubuntu:16.04 (and even 16.10!) is too old to support?

Really seems like you should either get Ubuntu repos updated to a more recent nodejs, or support the "current" node on LTS releases.

Example Dockerfile reproducing the failure:

FROM	ubuntu:16.10
RUN	apt-get update
RUN apt-get install -y nodejs npm
RUN npm install -g bower grunt-cli protractor protractor-html-screenshot-reporter
RUN ln -s /usr/bin/nodejs /usr/bin/node
RUN webdriver-manager update
...
Step 6/6 : RUN webdriver-manager update
/usr/local/lib/node_modules/protractor/node_modules/webdriver-manager/built/lib/cli/logger.js:66
     info(...msgs) {
            ^^^

Or I guess I should be running https://deb.nodesource.com/setup to install node instead of using apt-get? Yup, this works:

FROM	ubuntu:16.04
RUN	apt-get update && apt-get install -y curl
RUN curl -fsSL https://deb.nodesource.com/setup_6.x | bash -
RUN apt-get install -y nodejs
RUN npm config set spin=false
RUN npm install -g bower grunt-cli protractor protractor-html-screenshot-reporter
RUN webdriver-manager update

@caneraydinbey
Copy link

caneraydinbey commented Jan 23, 2017

vegan@vegan:$ nodejs -v
v5.12.0
vegan@vegan:
$ npm -v
3.8.6

but still not working.

chromedriver is up to date.
gateway@0.0.0 /home/vegan/hb-productupload/gateway
└─┬ protractor@3.1.1
└─┬ selenium-webdriver@2.48.2
├── tmp@0.0.24
├── ws@0.8.1
└─┬ xml2js@0.4.4
└── sax@0.6.1

@cnishina
Copy link
Member

@caneraydinbey Not sure what the context of the comment above is about. Looks like you are installing a really old version of protractor. You should try to stay current.

@cnishina
Copy link
Member

Also, I'm planning to lock this conversation since it has been resolved. Please open up a new issues. Closed issues do not get a lot of attention.

@angular angular locked and limited conversation to collaborators Jan 24, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests