asdf-nodejs
asdf-nodejs copied to clipboard
bug: Installed node does not displays version and my application fails to run
Describe the Bug
I installed node js as per instructions. Afterwards, I run the command with the following outputs:
asdf list nodejs 18.0.0 pnpm 7.0.0
node -version No version is set for command node Consider adding one of the following versions in your config file at nodejs 18.0.0 Exception: node exited with 126 [tty 5], line 1:
The following is an attempt to run my application: ng serve -c development
/home/pim/node_modules/.bin/ng: 16: exec: node: not found ELIFECYCLE Command failed. The terminal process "/usr/bin/bash '-c', 'pnpm run serve:dev'" failed to launch (exit code: 1).
Terminal will be reused by tasks, press any key to close it.
Steps to Reproduce
- Install asdf core.
- Install node and pnpm dependencies
- install nodejs and pnpm
Expected Behaviour
I expected node -version to print the version number: 18.0.0
Actual Behaviour
node -version No version is set for command node Consider adding one of the following versions in your config file at nodejs 18.0.0 Exception: node exited with 126 [tty 5], line 1:
Environment
OS:
Linux scsc 5.4.0-74-generic asdf-vm/asdf#83-Ubuntu SMP Sat May 8 02:35:39 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
SHELL:
GNU bash, version 5.0.17(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
ASDF VERSION: v0.10.0-77fd510
ASDF ENVIRONMENT VARIABLES: ASDF_DIR=/home/stclair/.asdf
ASDF INSTALLED PLUGINS:
nodejs https://github.com/asdf-vm/asdf-nodejs.git master b2d06a7
pnpm https://github.com/jonathanmorley/asdf-pnpm.git master 95752a9
asdf plugins affected (if relevant)
nodejs pnpm
I have moved this issue to the nodejs repo because I do not believe there are any issues with asdf-core contributing to this.
Have you tried running asdf reshim after installing nodejs and npm?
asdf list list all available versions, it doesn't show which one is being currently used. Try running asdf current to show which versions are being used
For setting a default global version you need to run asdf global nodejs <version>, so that asdf can fallback to it when not in a directory with a .tool-versions file.
Check if that works for you @st-clair-clarke