Fixing "Killed: 9" error when running "node"

Viewed 978

When I run node I get Killed: 9. I've restarted, uninstalled node, uninstalled npm and uninstalled n and then reinstalled all of them.

After reinstall. Node initially will work, i.e. running node will open a REPL. However, upon running npm install -g n and running n, node becomes broken again.

This is true for every version of node. The executable becomes broken. There's a stack trace to my n installation for failing at this:

execute_with_version() {
  test -z $1 && abort "version required"
  local version=${1#v}

  if [ "$version" = "latest" ]; then
    version=$(display_latest_version)
  fi

  if [ "$version" = "stable" ]; then
    version=$(display_latest_stable_version)
  fi

  if [ "$version" = "lts" ]; then
    version=$(display_latest_lts_version)
  fi

  local bin=${VERSIONS_DIR[$DEFAULT]}/$version/bin/node

  shift # remove version

  if test -f $bin; then
    $bin "$@"
  else
    abort "$version is not installed"
  fi
}

Advice?

Solution (but not really)

Don't use the program, in this case n, after corrupting the process. I switched to nvm and that seems to work. I force terminated a foreman process that was using node. My guess is that it didn't clean up what it needed to and was still being cached even on new installations (please someone correct this).

1 Answers

It happened to me after i accidently involved node's "n" command. Now i ran "n" again

enter image description here

Press enter and everything was fine after.

Related