textlint-rule / textlint-rule-no-dead-link

textlint rule to check if all links are alive.
29 stars 11 forks source link

“SyntaxError: Unexpected token *” is returned in no-dead-link.js: 263 when used with Docker #130

Closed f-teruhisa closed 4 years ago

f-teruhisa commented 4 years ago

Hi. I run textlint(and textlint-rule-no-dead-link) with Docker.

But, textlint-rule-no-dead-lin seems to return an error... I don't have an idea how to solve it.

I thought it was due to the setting of .textlintrc and MarkDown file, but there is no part using *.

The error text and source code are described below. If you know what the error is, I want you to know the cause or solution.

$ docker-compose run <CONTAINER_NAME> ./node_modules/.bin/textlint
✖ Error
Unexpected token *

✖ Stack trace
/node_modules/textlint-rule-no-dead-link/lib/no-dead-link.js:263
            yield waitTimeMs(currentRetryCount ** 2 * 100);
                                                ^
SyntaxError: Unexpected token *
    at Object.exports.runInThisContext (vm.js:76:16)
    at Module._compile (module.js:542:28)
    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 TextLintModuleLoader.loadRule (/node_modules/textlint/lib/textlint/src/engine/textlint-module-loader.js:176:58)
    at /node_modules/textlint/lib/textlint/src/engine/textlint-module-loader.js:70:23
make: *** [lint] Error 1

https://github.com/f-teruhisa/blog-linter

azu commented 4 years ago

It look that Node.js version is old. https://node.green/#ES2016-features-exponentiation------operator ** operator is supported in Node.js 8+. What is version of Node.js that is used?

f-teruhisa commented 4 years ago

@azu Oh, thanks.

I notice my Node.js is too old. I will update my Node.js.

Step 8/11 : RUN node -v
 ---> Running in 1c533e81e642
v6.9.5