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 './subvalidators' #4

Closed
ktomk opened this issue Aug 10, 2021 · 8 comments
Closed

Error: Cannot find module './subvalidators' #4

ktomk opened this issue Aug 10, 2021 · 8 comments

Comments

@ktomk
Copy link

ktomk commented Aug 10, 2021

Running npx nodelinter at project root of n8n-io/n8n clone throws:

$ npx nodelinter --option
internal/modules/cjs/loader.js:888
  throw err;
  ^

Error: Cannot find module './subvalidators'
Require stack:
- /home/user/.npm/_npx/3480a7d4487c2a23/node_modules/nodelinter/dist/services/Validator.js
- /home/user/.npm/_npx/3480a7d4487c2a23/node_modules/nodelinter/dist/services/index.js
- /home/user/.npm/_npx/3480a7d4487c2a23/node_modules/nodelinter/dist/scripts/lintAll.js
- /home/user/.npm/_npx/3480a7d4487c2a23/node_modules/nodelinter/dist/index.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:885:15)
    at Function.Module._load (internal/modules/cjs/loader.js:730:27)
    at Module.require (internal/modules/cjs/loader.js:957:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.<anonymous> (/home/user/.npm/_npx/3480a7d4487c2a23/node_modules/nodelinter/dist/services/Validator.js:61:34)
    at Module._compile (internal/modules/cjs/loader.js:1068:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1097:10)
    at Module.load (internal/modules/cjs/loader.js:933:32)
    at Function.Module._load (internal/modules/cjs/loader.js:774:14)
    at Module.require (internal/modules/cjs/loader.js:957:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/home/user/.npm/_npx/3480a7d4487c2a23/node_modules/nodelinter/dist/services/Validator.js',
    '/home/user/.npm/_npx/3480a7d4487c2a23/node_modules/nodelinter/dist/services/index.js',
    '/home/user/.npm/_npx/3480a7d4487c2a23/node_modules/nodelinter/dist/scripts/lintAll.js',
    '/home/user/.npm/_npx/3480a7d4487c2a23/node_modules/nodelinter/dist/index.js'
  ]
}

Additional info:

  • $ git describe --tags --always --first-parent --dirty=+dirty
    n8n@0.133.0
    
  • Reproducible: always
@ktomk
Copy link
Author

ktomk commented Aug 10, 2021

This looks like an initialization problem and/or a user error to me (just started to use it).

When a more saying (to me) command-line is in use:

npx nodelinter --target packages/nodes-base/nodes/SeaTable

gives the same error-picture.

I've just started to integrate with it for a n8n node PR: n8n-io/n8n#1976

@ivov
Copy link
Collaborator

ivov commented Aug 10, 2021

Thanks for your report.

In the command npx nodelinter --option, --option is a stand-in meant to be replaced with one of the actual options listed in the README, e.g. target, config, etc. I will make this clearer.

When running via npx, --target expects an absolute path:

npx nodelinter --target=/Users/john/n8n/packages/nodes-base/nodes/Stripe

Let me know if you have further questions.

@ktomk
Copy link
Author

ktomk commented Aug 10, 2021

When running via npx, --target expects an absolute path:

Given an absolute path, I see the same error picture:

$ file $(pwd)/packages/nodes-base/nodes/SeaTable
/home/user/path/to/n8n/packages/nodes-base/nodes/SeaTable: directory
$ npx nodelinter --target $(pwd)/packages/nodes-base/nodes/SeaTable
internal/modules/cjs/loader.js:888
... # same as above

For the error in the report, does it require to have more options maybe to aide by configuration? @ivov

@ivov
Copy link
Collaborator

ivov commented Aug 10, 2021

Tested on Mac and Windows with and without the equals sign = and it works consistently. Omitting the config will cause it to fall back to the default config.

Apologies for the inconvenience. Will check with the team to see if someone can reproduce - in the meantime, you can try to run it locally:

git clone https://github.com/n8n-io/nodelinter
cd nodelinter; npm i
npm run lint -- --target=...

image

@ivov
Copy link
Collaborator

ivov commented Aug 10, 2021

The team cannot reproduce the issue either.

Follow-up questions:

  • Are you able to run npx n8n to check if your npx is having issues?
  • Can you clear your npx cache and retry? rm -rf $(npm get cache)/_npx/*

@ivov
Copy link
Collaborator

ivov commented Aug 12, 2021

Managed to reproduce this. The cause was Linux case sensitivity and was fixed today. The package has been republished, so you should now be able to run it via npx.

@ivov
Copy link
Collaborator

ivov commented Aug 16, 2021

Closing for now as I have confirmation from Linux users that this is working.

Otherwise feel free to comment here and I will reopen.

@ivov ivov closed this as completed Aug 16, 2021
@ktomk
Copy link
Author

ktomk commented Aug 16, 2021

can confirm fix version nodelinter@0.1.11.

FYI: --target does not require an absolute path on my end.

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

2 participants