Support custom nodeenv options
This is transferred from microsoft/pyright#3414. Possibly related to #56.
pyright crashes with the following error after node 18 has been released.
> pyright myproject
* Install prebuilt node (18.0.0) ..... done.
node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by node)
I'm running ubuntu 18.04. There seems to be no obvious (/convenient) way to upgrade my glibc 2.27 to 2.28. After a little digging, I found that pyright is using nodeenv to create a clean node environment under /tmp/pyright.username, and nodeenv automatically looks for latest stable. Unfortunately, although nodeenv provides way to restrain the node version, pyright didn't expose such ability.
A possible solution is to constrain the node versions in pyright. I did that by hacking pyright's python package.
def _install_node_env() -> None:
log.debug('Installing nodeenv to %s', ENV_DIR)
args = [sys.executable, '-m', 'nodeenv', str(ENV_DIR), '--node=16.15.0'] # I added node version here
log.debug('Running command with args: %s', args)
subprocess.run(args, check=True)
I was hoping that pyright could address that natively.
Thanks for the report.
The solution that I can see here is to support passing arguments to nodeenv.
We're also running into this issue, would appreciate a fix!
Yup, running into this issue as well.