help with nodejs-related compile issue ("Unexpected token =>")

498 views
Skip to first unread message

Paweł Hajdan, Jr.

unread,
Aug 2, 2017, 11:14:46 AM8/2/17
to chromium-dev
Hey folks,

I'd be looking for some assistance with a user-reported compile error I didn't manage to reproduce: https://bugs.gentoo.org/show_bug.cgi?id=625016 .
FAILED: python ../../chrome/browser/resources/polymer_css_build_gn.py --out_folder gen/chrome/browser/resources/md_history --input_files app.vulcanized.unbuilt.html lazy_load.vulcanized.unbuilt.html --output_files app.vulcanized.html lazy_load.vulcanized.html
../../third_party/node/linux/node-linux-x64/bin/node ../../third_party/node/node_modules/polymer-css-build/bin/polymer-css-build --no-inline-includes -f /var/tmp/portage/www-client/chromium-59.0.3071.104/work/chromium-59.0.3071.104/out/Release/gen/chrome/browser/resources/md_history/app.vulcanized.unbuilt.html /var/tmp/portage/www-client/chromium-59.0.3071.104/work/chromium-59.0.3071.104/out/Release/gen/chrome/browser/resources/md_history/lazy_load.vulcanized.unbuilt.html -o /var/tmp/portage/www-client/chromium-59.0.3071.104/work/chromium-59.0.3071.104/out/Release/gen/chrome/browser/resources/md_history/app.vulcanized.html /var/tmp/portage/www-client/chromium-59.0.3071.104/work/chromium-59.0.3071.104/out/Release/gen/chrome/browser/resources/md_history/lazy_load.vulcanized.html failed:
/var/tmp/portage/www-client/chromium-59.0.3071.104/work/chromium-59.0.3071.104/third_party/node/node_modules/polymer-css-build/bin/polymer-css-build:83
const docs = args.file.map(f => ({
                              ^
SyntaxError: Unexpected token >
    at Module._compile (module.js:439:25)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:906:3
I suspect this could be caused by too old nodejs (Gentoo uses system-installed one). Is my guess plausible?

Do you have any other comments on this?

Paweł

Jakob Kummerow

unread,
Aug 2, 2017, 3:46:04 PM8/2/17
to Paweł Hajdan, Jr., chromium-dev
It does look like node.js is simply too old. Judging from version numbers alone, all node.js versions since 4.0 should have a V8 inside that's new enough to know about Arrow Functions; in particular that includes the latest stable nodejs package in Gentoo. On the other hand, if this user is updating from Chromium 49 to 59, then they're clearly not updating very often, so it seems like a plausible guess that their nodejs version is older than that.

Advice to the user: 
- use emerge -uDN --keep-going repeatedly, that should fix this
- update a little more frequently in the future, especially their web browser shouldn't be 10 versions (=1.5 years) behind

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/CAATLsPbOcTZ%3DSnoexeX-nxX0yT4D61xJLC%2B0%2BsGHAsi5eZ8WBQ%40mail.gmail.com.

Paweł Hajdan, Jr.

unread,
Aug 4, 2017, 6:08:07 AM8/4/17
to Jakob Kummerow, chromium-dev
Thank you.

I had to run more tests since the user didn't report specific nodejs version.

Indeed, I fixed this with updating minimum required version of nodejs to 4.6.1.

Paweł

dpapad

unread,
Aug 4, 2017, 5:24:02 PM8/4/17
to Chromium-dev, jkum...@chromium.org
Chromium's toolchain is using the Node JS binary under third_party/node/ so there should be no problem with the Node JS version (assuming gclient sync has been run first). I can't tell much from the report above, but it looks as if somehow the a different version of NodeJS was used, not the one in third_party.
Reply all
Reply to author
Forward
0 new messages