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

Error: Cannot find module 'eslint' #54

Open
sa9sha9 opened this issue Nov 24, 2020 · 3 comments
Open

Error: Cannot find module 'eslint' #54

sa9sha9 opened this issue Nov 24, 2020 · 3 comments

Comments

@sa9sha9
Copy link

sa9sha9 commented Nov 24, 2020

I guess it's because this runner works on GITHUB_WORKSPACE only.

So it should have an option for setup working-directory.

my repo hierarchy

.
├── README.md
├── app/          // package.json is in.
└── .github/

ESLint plus echo

Run bradennapier/eslint-plus-action@v3
/usr/bin/docker run --name e102c9c1775b44d4bf538177857d02aa_903977 --label 179394 --workdir /github/workspace --rm -e INPUT_GITHUB-TOKEN -e INPUT_REPORTWARNINGS -e INPUT_REPORTWARNINGSASERRORS -e INPUT_REPORTIGNOREDFILES -e INPUT_REPORTSUGGESTIONS -e INPUT_ISSUESUMMARY -e INPUT_ISSUESUMMARYTYPE -e INPUT_ISSUESUMMARYMETHOD -e INPUT_ISSUESUMMARYONLYONEVENT -e INPUT_EXTENSIONS -e INPUT_INCLUDEGLOB -e INPUT_IGNOREGLOB -e INPUT_CONFIGFILE -e INPUT_RULEPATHS -e INPUT_ERRORONUNMATCHEDPATTERN -e INPUT_USEESLINTRC -e INPUT_USEESLINTIGNORE -e INPUT_FIX -e INPUT_NPMINSTALL -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_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_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e GITHUB_ACTION_REPOSITORY -e GITHUB_ACTION_REF -e GITHUB_PATH -e GITHUB_ENV -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_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/hoge/hoge":"/github/workspace" 179394:e102c9c1775b44d4bf538177857d02aa  "***" "false"
ENTRY
Install Yarn
[pushd] [/github/workspace] -> [/action]
Yarn Action Install
yarn install v1.22.5
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents@2.1.3: The platform "linux" is incompatible with this module.
info "fsevents@2.1.3" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
Done in 17.77s.
[popd] [/action] -> [/github/workspace]
Execute From Directory: /github/workspace     // This line should be controllable 
internal/modules/cjs/loader.js:883
  throw err;
  ^

Error: Cannot find module 'eslint'
Require stack:
- /action/lib/eslint.js
- /action/lib/run.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
    at Function.Module._load (internal/modules/cjs/loader.js:725:27)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.<anonymous> (/action/lib/eslint.js:5:18)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Module.require (internal/modules/cjs/loader.js:952:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ '/action/lib/eslint.js', '/action/lib/run.js' ]
}
@Zodiase
Copy link

Zodiase commented Dec 16, 2020

I have the same problem. In my case I have multiple projects using eslint in different directories and I need a way to specify their locations. I wishworking-directory in https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#jobsjob_iddefaultsrun could work with this action.

@finnatsea
Copy link

I also have multiple eslint configs in one repo.

Could we get a way to specify the cwd? As @Zodiase mentioned, run: working-directory: app doesn't work with the uses command.

@zombozo
Copy link

zombozo commented Jun 28, 2021

alguna solucion para este problema? he utilizado las configuraciones del ejemplo de la documentacion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants