asdf-vm / asdf-vm/asdf-nodejs

bug: nodejs plugin segfault with node `11.1.0`

Open
#368 4 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Shell
Stars
989
Forks
162
PR merge metrics
No merged PRs in 30d

Description

### Describe the Bug

When installing `nodejs 11.1.0` with asdf, `npm` always results in a _segmentation fault_ - no matter what 11-ish version of nodejs I try.

Unfortunately, `nodejs 11.1.0` is the latest version I can use for that project, as it depends on old tools that fail with later versions. Since nodejs is only used locally, it's not a security issue.

### Steps to Reproduce

1. run `asdf install nodejs 11.1.0`
2. run `asdf local nodejs 11.1.0`
3. run `npm`
4. get a `segmentation fault (core dumped) npm`

### Expected Behaviour

npm should run and output it's usage information. nvm for example installs `npm 6.4.1` alongside with `nodejs 11.1.0` and that runs fine. I would expect the same behaviour with asdf.

### Actual Behaviour

segmentation fault (core dumped) npm

### Environment (old)

```shell
OS:
Linux PF43TMKF 6.2.0-32-generic asdf-vm/asdf#32~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Aug 18 10:40:13 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

SHELL:
zsh 5.8.1 (x86_64-ubuntu-linux-gnu)

ASDF VERSION:
v0.8.1-a1ef92a

ASDF ENVIRONMENT VARIABLES:
ASDF_DIR=/home/roman/.asdf

ASDF INSTALLED PLUGINS:
java https://github.com/halcyon/asdf-java.git
nodejs https://github.com/asdf-vm/asdf-nodejs.git
```
### Environment (after I updated asdf)

```shell
OS:
Linux PF43TMKF 6.2.0-32-generic asdf-vm/asdf#32~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Aug 18 10:40:13 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

SHELL:
zsh 5.8.1 (x86_64-ubuntu-linux-gnu)

BASH VERSION:
5.1.16(1)-release

ASDF VERSION:
v0.13.1-0586b37

ASDF INTERNAL VARIABLES:
ASDF_DEFAULT_TOOL_VERSIONS_FILENAME=.tool-versions
ASDF_DATA_DIR=/home/roman/.asdf
ASDF_DIR=/home/roman/.asdf
ASDF_CONFIG_FILE=/home/roman/.asdfrc

ASDF INSTALLED PLUGINS:
java https://github.com/halcyon/asdf-java.git master 13019d3
nodejs https://github.com/asdf-vm/asdf-nodejs.git master 9275f49
```

### asdf plugins affected (if relevant)

nodejs

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the failure with `asdf install nodejs 11.1.0`, `asdf local nodejs 11.1.0`, and `npm`, using the reported environment details. Trace the nodejs plugin's installation and runtime handling for Node.js 11, then verify that `npm` runs and prints its usage information without a segmentation fault.

Written by the indexing model from the issue text.

Assessment

Tech stack
nodejs, shell
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.