Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failing to install node 8.14.0 #136

Closed
eng618 opened this issue Jul 11, 2019 · 24 comments
Closed

Failing to install node 8.14.0 #136

eng618 opened this issue Jul 11, 2019 · 24 comments

Comments

@eng618
Copy link

eng618 commented Jul 11, 2019

I have installed the keyring per the README

bash ~/.asdf/plugins/nodejs/bin/import-release-team-keyring

then when I try to install 8.14.0 I get the following error

15:06:58 ▶ asdf install nodejs 8.14.0
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  4240    0  4240    0     0  21785      0 --:--:-- --:--:-- --:--:-- 21855
gpg: Signature made Tue Nov 27 19:39:57 2018 EST
gpg:                using RSA key DD8F2338BAE7501E3DD5AC78C273792F7D83545D
gpg: Good signature from "Rod Vagg <[email protected]>" [unknown]
gpg:                 aka "Rod Vagg <[email protected]>" [unknown]
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: DD8F 2338 BAE7 501E 3DD5  AC78 C273 792F 7D83 545D
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 14.6M  100 14.6M    0     0  16.9M      0 --:--:-- --:--:-- --:--:-- 16.9M
sha256sum or shasum is not available for use
Authenticity of package archive can not be assured. Exiting.
@Stratus3D
Copy link
Member

You need to install sha256sum or shasum on your system. We should probably document this in the readme.

@eng618
Copy link
Author

eng618 commented Jul 12, 2019

What is the recommended way to install sha256sum or shasum on macOS?

@eng618
Copy link
Author

eng618 commented Jul 12, 2019

also once I have one installed it's not registering the node command.

note: I set NODEJS_CHECK_SIGNATURES=no to install 8.14.0 just to test, but can not use this as the norm.

image

@eng618
Copy link
Author

eng618 commented Jul 12, 2019

I tried this https://unix.stackexchange.com/a/484429/294293 but didn't help at all

@Stratus3D
Copy link
Member

You may need to reshim to get the node executable to show up. asdf reshim should work.

What happened when you installed coreutils? I'm using sha256sum from coreutils on OSX and it works for me.

@eng618
Copy link
Author

eng618 commented Jul 15, 2019

Seemed to be installed normally

06:36:51 ▶ brew reinstall coreutils
==> Reinstalling coreutils 
==> Downloading https://homebrew.bintray.com/bottles/coreutils-8.31.mojave.bottle.tar.gz
Already downloaded: /Users/engarcia/Library/Caches/Homebrew/downloads/9959cbfa6463a887579a35eac1c66f07dd959ac9158464a1ae1581912e6724ca--coreutils-8.31.mojave.bottle.tar.gz
==> Pouring coreutils-8.31.mojave.bottle.tar.gz
==> Caveats
Commands also provided by macOS have been installed with the prefix "g".
If you need to use these commands with their normal names, you
can add a "gnubin" directory to your PATH from your bashrc like:
  PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"
==> Summary
🍺  /usr/local/Cellar/coreutils/8.31: 476 files, 8.8MB

I added PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH" to my .bashrc

@Stratus3D
Copy link
Member

Strange. type -a sha256sum doesn't return anything? You might check the issue tracker for coreutils. I'm not very familiar with it.

@eng618
Copy link
Author

eng618 commented Jul 15, 2019

14:19:57 ▶ type -a sha256sum
sha256sum is /usr/local/bin/sha256sum
sha256sum is /usr/local/opt/coreutils/libexec/gnubin/sha256sum
sha256sum is /usr/local/bin/sha256sum
sha256sum is /usr/local/opt/coreutils/libexec/gnubin/sha256sum
sha256sum is /usr/local/bin/sha256sum

@eng618
Copy link
Author

eng618 commented Jul 15, 2019

also ran asdf reshim and didn't fix it

@Stratus3D
Copy link
Member

It looks like you've got duplicate paths in $PATH. You shouldn't see duplicate lines in the output from type. I'm not sure what the issue is, but if you are getting the same error it is because those commands it is complaining about are not available. There could be many reasons for that.

@eng618
Copy link
Author

eng618 commented Jul 15, 2019

Okay, had some funky outdated stuff in my .bashrc so I'm installing fine now, but still not able to execute anything against node

@Stratus3D
Copy link
Member

I'm not sure what's going on so please provide any errors or stacktraces you are seeing. Again, type -a node should provide some insight into how things are setup on your system.

@eng618
Copy link
Author

eng618 commented Jul 16, 2019

/Users/engarcia ✔ 
09:02:45 ▶ type -a node
-bash: type: node: not found
/Users/engarcia ✘-1
09:03:13 ▶ asdf reshim 
/Users/engarcia ✔ 
09:03:19 ▶ asdf list nodejs 
  12.6.0
  6.17.0
  8.14.0
/Users/engarcia ✔ 
09:03:23 ▶ asdf current nodejs 
12.6.0   (set by /Users/engarcia/.tool-versions)
/Users/engarcia ✔ 
09:03:32 ▶ type -a node
-bash: type: node: not found

@Stratus3D
Copy link
Member

The output from those asdf commands looks correct, but type isn't finding node. Have you verified the shim directory is on your path and contains the node shim? It's typically ~/.asdf/shims.

@eng618
Copy link
Author

eng618 commented Jul 16, 2019

The directory does have the shim, but it is not on my path.

Is this supposed to be added to my path through "$(brew --prefix asdf)"/asdf.sh

@eng618
Copy link
Author

eng618 commented Jul 16, 2019

I can add that manually and it works, but I don't see that anywhere in the documentation, and assumed it was handled by the init with asdf.sh

@Stratus3D
Copy link
Member

"$(brew --prefix asdf)"/asdf.sh should add that path automatically. I'm not sure why it's not. It does check for the shim path already being set before setting it, so it's possible it thinks you've already got the shim directory on your path.

As an experiment (not a solution) you might try stripping your $PATH down to just a few directories you have to have, and then running "$(brew --prefix asdf)"/asdf.sh. It should add the shim directory, and if it's not this is likely a bug.

This could be related to asdf-vm/asdf#428

@eng618
Copy link
Author

eng618 commented Jul 16, 2019

Does not seem to be adding it to the path

/Users/engarcia ✔ 
09:54:18 ▶ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/Wireshark.app/Contents/MacOS
/Users/engarcia ✔ 
09:54:29 ▶ cd $(brew --prefix asdf)
/usr/local/opt/asdf ✔ 
09:54:43 ▶ ./asdf.sh 
/usr/local/opt/asdf ✔ 
09:54:47 ▶ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/Wireshark.app/Contents/MacOS

@Stratus3D
Copy link
Member

Which version of asdf are you running? Can you cat the asdf.sh file and paste it here?

@eng618
Copy link
Author

eng618 commented Jul 16, 2019

version: v0.7.2

/usr/local/opt/asdf ✔ 
10:07:20 ▶ cat asdf.sh 
#!/usr/bin/env bash

# For Korn shells (ksh, mksh, etc.), capture $_ (the final parameter passed to
# the last command) straightaway, as it will contain the path to this script.
# For Bash, ${BASH_SOURCE[0]} will be used to obtain this script's path.
# For Zsh and others, $0 (the path to the shell or script) will be used.
_under="$_"
if [ "${BASH_SOURCE[0]}" != "" ]; then
  current_script_path="${BASH_SOURCE[0]}"
elif [[ "$_under" == *".sh" ]]; then
  current_script_path="$_under"
else
  current_script_path="$0"
fi

export ASDF_DIR
ASDF_DIR="$(dirname "$current_script_path")"
# shellcheck disable=SC2016
[ -d "$ASDF_DIR" ] || echo '$ASDF_DIR is not a directory'

# Add asdf to PATH
#
# if in $PATH, remove, regardless of if it is in the right place (at the front) or not.
# replace all occurrences - ${parameter//pattern/string}
ASDF_BIN="${ASDF_DIR}/bin"
ASDF_USER_SHIMS="${ASDF_DATA_DIR:-$HOME/.asdf}/shims"
[[ ":$PATH:" == *":${ASDF_BIN}:"* ]] && PATH="${PATH//$ASDF_BIN:/}"
[[ ":$PATH:" == *":${ASDF_USER_SHIMS}:"* ]] && PATH="${PATH//$ASDF_USER_SHIMS:/}"
# add to front of $PATH
PATH="${ASDF_BIN}:$PATH"
PATH="${ASDF_USER_SHIMS}:$PATH"

# Add function wrapper so we can export variables
asdf() {
  local command
  command="$1"
  if [ "$#" -gt 0 ]; then
    shift
  fi

  case "$command" in
    "shell")
      # eval commands that need to export variables
      eval "$(asdf "sh-$command" "$@")";;
    *)
      # forward other commands to asdf script
      command asdf "$command" "$@";;

  esac
}

if [ -n "$ZSH_VERSION" ]; then
  autoload -U bashcompinit
  bashcompinit
fi

@eng618
Copy link
Author

eng618 commented Jul 16, 2019

Temporarily have everything working with adding the following to my bashrc

export PATH="$HOME/.asdf/shims:$PATH"
export ASDF_DIR=$(brew --prefix asdf)

@Stratus3D
Copy link
Member

I think you are missing the source command before the path to the file ("$(brew --prefix asdf)"/asdf.sh). Can you verify you are sourcing the script, and not executing it? The script must be sourced so the contents of it are executed in the context of your .bashrc or equivalent file.

@Stratus3D
Copy link
Member

You should end up with a line exactly like this in your .bashrc:

. "$(brew --prefix asdf)"/asdf.sh

@eng618
Copy link
Author

eng618 commented Jul 16, 2019

Okay, that definitely was missing, everything is working fine now.

Thanks for all the help

@eng618 eng618 closed this as completed Jul 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants