question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bugfix in v1.18 breaks when a core module is not available in a given node version

See original GitHub issue

v1.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:closed
  • Created 3 years ago
  • Comments:17 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
dlong500commented, Mar 2, 2021

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 setting eslint.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 see fs/promises as a core module.

Thanks for the responses. It helped me to narrow down the root cause of my issue.

1reaction
cruzdanilocommented, Oct 22, 2020

yes, fs/promises + resolve@1.17.0 + node@12 definitely pass

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found