max / awesome-lint

awesome-lint as a GitHub Action
20 stars 5 forks source link

SyntaxError: Unexpected identifier for "process" #7

Open satta opened 8 months ago

satta commented 8 months ago

I recently noticed that my lint runs all fail recently with the following message:

Run max/awesome-lint@v2.0.0
/usr/bin/docker run --name a070f5450a57735954b9e856e8bab517c956b_47fe83 --label 2a070f --workdir /github/workspace --rm -e "INPUT_FILENAME" -e "HOME" -e "GITHUB_JOB" -e "GITHUB_REF" -e "GITHUB_SHA" -e "GITHUB_REPOSITORY" -e "GITHUB_REPOSITORY_OWNER" -e "GITHUB_REPOSITORY_OWNER_ID" -e "GITHUB_RUN_ID" -e "GITHUB_RUN_NUMBER" -e "GITHUB_RETENTION_DAYS" -e "GITHUB_RUN_ATTEMPT" -e "GITHUB_REPOSITORY_ID" -e "GITHUB_ACTOR_ID" -e "GITHUB_ACTOR" -e "GITHUB_TRIGGERING_ACTOR" -e "GITHUB_WORKFLOW" -e "GITHUB_HEAD_REF" -e "GITHUB_BASE_REF" -e "GITHUB_EVENT_NAME" -e "GITHUB_SERVER_URL" -e "GITHUB_API_URL" -e "GITHUB_GRAPHQL_URL" -e "GITHUB_REF_NAME" -e "GITHUB_REF_PROTECTED" -e "GITHUB_REF_TYPE" -e "GITHUB_WORKFLOW_REF" -e "GITHUB_WORKFLOW_SHA" -e "GITHUB_WORKSPACE" -e "GITHUB_ACTION" -e "GITHUB_EVENT_PATH" -e "GITHUB_ACTION_REPOSITORY" -e "GITHUB_ACTION_REF" -e "GITHUB_PATH" -e "GITHUB_ENV" -e "GITHUB_STEP_SUMMARY" -e "GITHUB_STATE" -e "GITHUB_OUTPUT" -e "RUNNER_OS" -e "RUNNER_ARCH" -e "RUNNER_NAME" -e "RUNNER_ENVIRONMENT" -e "RUNNER_TOOL_CACHE" -e "RUNNER_TEMP" -e "RUNNER_WORKSPACE" -e "ACTIONS_RUNTIME_URL" -e "ACTIONS_RUNTIME_TOKEN" -e "ACTIONS_CACHE_URL" -e "ACTIONS_RESULTS_URL" -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/awesome-suricata/awesome-suricata":"/github/workspace" 2a070f:5450a57735954b9e856e8bab517c956b  ""
/usr/local/lib/node_modules/awesome-lint/cli.js:2
import process from 'node:process';
       ^^^^^^^

SyntaxError: Unexpected identifier
    at Module._compile (internal/modules/cjs/loader.js:723:23)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)

For use see https://github.com/satta/awesome-suricata/blob/main/.github/workflows/lint.yml

Unfortunately my JS experience is limited, so I'd appreciate any pointer.

satta commented 8 months ago

Apparently the npm install step gave valuable insight like:

[Lint Awesome List/Lint] [DEBUG]  Unsupported engine for mimic-fn@4.0.0: wanted: {"node":">=12"} (current: {"node":"10.24.1","npm":"6.14.12"})
[Lint Awesome List/Lint] [DEBUG] npm WARN notsup Unsupported engine for @sindresorhus/is@5.6.0: wanted: {"node":">=14.16"} (current: {"node":"12.22.12","npm":"6.14.16"})

After some iterative updates of the Node container version used, I just bumped to 18 (which is the lowest version currently available on Docker Hub) and that solved the issue.

PR here : #8