Repository navigation
make lint-js throws error #41771
Description
Activity
If you haven't compiled Node.js locally,
make lint-jswill use the version ofnodein your path. So I'm guessing you have Node.js 10.x or older installed. Node.js 10.x is unsupported and will result in this error.To fix the issue, you can either build Node.js locally (no need to install it--just having it built in the your project directory will be enough) or update your system Node.js to 12.x or newer.
Reacted by Benjamin Gruenbaum@MrJithil OK, that's surprising. What happens if you run
tools/node_modules/eslint/bin/eslint.jsfrom the command line?@MrJithil OK, that's surprising. What happens if you run
tools/node_modules/eslint/bin/eslint.jsfrom the command line?In particular, since you have the 18.0.0-pre compiled, do all three of these work?
$ tools/node_modules/eslint/bin/eslint.js $ node tools/node_modules/eslint/bin/eslint.js $ ./node tools/node_modules/eslint/bin/eslint.js $
Hmm, that's odd since it takes node from the environment so if
node tools/node_modules/eslint/bin/eslint.jspasses thentools/node_modules/eslint/bin/eslint.jsshould too.It might be a WSL related issue? (though why would it?) there is probably something else at play based on the environment.
Seems like the problem is happening in
call available-nodein the Makefile. Let's confirm that.Does
make tools/doc/node_modulesfail in a similar way? Or does that succeed?Reacted by Benjamin Gruenbaum- addedtoolsIssues and PRs related to the tools directory.Issues and PRs related to the tools directory.
on Jan 30, 2022 The way
makeworks, that didn't run anything because the target is already built. Do this to causemaketo try to run the recipe:touch tools/doc/package.json && make tools/doc/node_modulesIf that fails, at least we have a narrow area to find the cause of the problem. If that succeeds, the search continues....
touch: setting times of 'tools/doc/package.json': Invalid argumentGot this error
touch: setting times of 'tools/doc/package.json': Invalid argumentGot this error
OK, instead of using
touch, how about removetools/doc/node_modulesand then runmake tools/doc/node_modules?Sorry. I ran the previous command in the wrong shell. Now, I corrected it and ran
touch tools/doc/package.json && make tools/doc/node_modulesagain.Waiting for the results.
Seems like its taking time.
And below is the output @Trott

Are you sure you removed
tools/doc/node_modulesbefore runningmake tools/doc/node_modules? Can you confirm that whatever command you use to remove it succeeded? Maybe do a directory listing and confirm that it's not there? There's no way that removing the directory and then runningmake tools/doc/node_modulesshould report that the directory, which you just removed, is up to date. So either the directory was not removed, or else something is truly deeply broken withmake(or somethingmakedepends on) in your setup.Hello @Trott, Finally discovered the issue.
wsl instance unable to resolve the
npm.orgwas the underlying issue. I have changed the DNS resolver to 8.8.8.8 and restarted thesystemd-networkdservice. After restarting the windows, I am able to runmake tools/doc/node_modulessuccessfully.Also, as you suggested
tools/doc/node_modulesdirectory is hidden and not showing in the filesystem. I have run therm -r tools/doc/node_modulesto ensure this is completely removed from the disk.All good now. Thank you again @Trott for your kind support and a lot of effort to fix this case.
Reacted by Rich TrottGlad you got it worked out!
Reacted by Benjamin Gruenbaum and Jithil P PonnanI have the same issue on Windows (outside WSL):
PS C:\Users\x\workspace\nodejs\node> node -v v16.13.0 PS C:\Users\x\workspace\nodejs\node> node tools/node_modules/eslint/bin/eslint.js .eslintrc.js benchmark doc lib test tools Oops! Something went wrong! :( ESLint: 8.9.0 C:\Users\x\workspace\nodejs\node\tools\node_modules\eslint\node_modules\eslint:1 (function (exports, require, module, __filename, __dirname) { .. ^ SyntaxError: Unexpected token '.' at new Script (node:vm:100:7) at NativeCompileCache._moduleCompile (C:\Users\x\workspace\nodejs\node\tools\node_modules\eslint\node_modules\v8-compile-cache\v8-compile-cache.js:240:18) at Module._compile (C:\Users\x\workspace\nodejs\node\tools\node_modules\eslint\node_modules\v8-compile-cache\v8-compile-cache.js:184:36) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10) at Module.load (node:internal/modules/cjs/loader:981:32) at Function.Module._load (node:internal/modules/cjs/loader:822:12) at Module.require (node:internal/modules/cjs/loader:1005:19) at require (C:\Users\x\workspace\nodejs\node\tools\node_modules\eslint\node_modules\v8-compile-cache\v8-compile-cache.js:159:20) at Object.<anonymous> (C:\Users\x\workspace\nodejs\node\tools\node_modules\eslint\node_modules\eslint-plugin-jsdoc\dist\rules\checkExamples.js:8:15) at Module._compile (C:\Users\x\workspace\nodejs\node\tools\node_modules\eslint\node_modules\v8-compile-cache\v8-compile-cache.js:192:30)




Version
v18.0.0-pre
Platform
Linux 5.10.16.3-microsoft-standard-WSL2 #1 SMP Fri Apr 2 22:23:49 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Subsystem
tools
What steps will reproduce the bug?
run
make lint-jsand observe the errors in WSL Ubuntu. I have tried the latest source on macOS and faced the same.How often does it reproduce? Is there a required condition?
Always
What is the expected behavior?
Linters should run successfully.
What do you see instead?
Errors and linting broken
Additional information
No response