Repository navigation
Prevent unexpected token error on old node versions - #292
Conversation
- On node v8.16.0 mega-linter-runner fails to run - According to MDN it can be omitted if unused but it doesn't appear to hurt anything on many versions of node
|
Not sure I understand the failure here. If you want to proceed with this PR can you please provide some direction on resolving the issue? Not sure if it is related but I did get an error trying to run |
|
What was the error when you run bash buid.sh ? About the CI error, it's my fault, i'm on it ^^ |
Thanks for your feedback :) |
Sorry about not already providing that. I was already away from the computer when I commented. Here is the error I am seeing: File "./.automation/build.py", line 47
f"{REPO_HOME}/megalinter/descriptors/schemas/megalinter-descriptor.jsonschema.json"
^
SyntaxError: invalid syntaxI reran the commands from the prerequisite section but I am still seeing the error. |
quick build
|
It looks like the issue may persist but I did have to push that subsequent merge commit separately from the |
|
I think that you have an old python version, who does not support f-strings Please can you try to install latest Python3 and try again ? :) |
|
and about CI, there is still a bug on my side, sorry ^^ |
Will do, thanks! That seems like a likely issue. 😄 |
|
@joe-sharp I fixed the CI and tested it from a secondary account with a fork, it should be ok if now you merge nvuillam/mega-linter@master in your branch :) |
Thanks much, building now... |
|
|
Merged, thanks for your contribution :) |
|
@joe-sharp |
|
Works perfectly! ~/Documents/repos/mega-linter 🔮❯❯❯ nvm use node 8.16.0
Now using node v8.16.0 (npm v6.14.5)
~/Documents/repos/mega-linter 🔮❯❯❯ npx mega-linter-runner -v
Unexpected token {
~/Documents/repos/mega-linter 🔮❯❯❯ npx mega-linter-runner@beta -v
mega-linter-runner version 4.26.1-beta202101252205.0
~/Documents/repos/mega-linter 🔮❯❯❯ nvm use node 14.13.1
Now using node v14.13.1 (npm v6.14.8)
~/Documents/repos/mega-linter 🔮❯❯❯ npx mega-linter-runner@beta -v
mega-linter-runner version 4.26.1-beta202101252205.0 |
I found this issue on a workstation I didn't realize had such an old version of node. If there is no interest in supporting old versions I am fine with abandoning this change. Only node v8.16.0 failed without this change (out of the versions I tested.) The following versions do not require this change; v10.16.1, v11.15.0, or v14.13.1
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/try...catch#the_exception_identifier
Proposed Changes
Readiness Checklist
Author/Contributor
Updated CHANGELOG
Reviewing Maintainer
breakingif this is a large fundamental changeautomation,bug,documentation,enhancement,infrastructure, orperformance