bugfix in v1.18 breaks when a core module is not available in a given node version
See original GitHub issuev1.18 broke some eslint plugins inside vscode (node v12)
const { appendFile } = require('fs/promises');
gives the following errors:
- Unable to resolve path to module 'fs/promises'. eslint(import/no-unresolved)
- "fs/promises" is not found. eslint(node/no-missing-require)
when running via cli using node v14 there is no error
Issue Analytics
- State:
- Created 3 years ago
- Comments:17 (9 by maintainers)
Top Results From Across the Web
[BUG] npm ci can't resolve dependencies without --force, or ...
I've updated to latest node version which use npm 8.11.0, but the problem exist with versions >= 8.6.0 up to 8.12.1.
Read more >How To Use Node.js Modules with npm and package.json
This tutorial uses version 18.3.0. To install this on macOS, follow the steps in How to Install Node.js and Create a Local Development ......
Read more >Download & Update Node.js to the Latest Version! Node v19 ...
Direct download links to update to the latest Node.js versions: Node v19.0.0 / LTS v16.18.0.
Read more >The engine "node" is incompatible with this module
yes , you are getting this error because of incompatibility between the package version and node engine. – Shubham Sharma. Jun 16, 2019...
Read more >Go 1.18 Release Notes - The Go Programming Language
In other words, it is possible that there will be code using generics that will work with the 1.18 release but break in...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Just to follow up: I did figure out with the vscode eslint extension you can add an
eslint.runtime
setting to specify a node executable to use when running eslint. This is supposed to be a path, but just settingeslint.runtime: "node"
appears to be enough to get eslint to use the version of node installed on the system and not the internal version used by vscode (it probably works because it looks at the system path variable which includes the external node binary). And yes, this does allow eslint to properly seefs/promises
as a core module.Thanks for the responses. It helped me to narrow down the root cause of my issue.
yes,
fs/promises
+ resolve@1.17.0 + node@12 definitely pass