<commit_before>install_node_modules() {
  local build_dir=${1:-}

  if [ -e $build_dir/package.json ]; then
    cd $build_dir
    echo "Pruning any extraneous modules"
    # npm prune --unsafe-perm --userconfig $build_dir/.npmrc 2>&1
    npm prune --unsafe-perm --userconfig $HOME/.npmrc 2>&1
    if [ -e $build_dir/npm-shrinkwrap.json ]; then
      echo "Installing node modules (package.json + shrinkwrap)"
    else
      echo "Installing node modules (package.json)"
    fi
    # npm install --unsafe-perm --userconfig $build_dir/.npmrc 2>&1
    npm install --global --unsafe-perm --userconfig $HOME/.npmrc 2>&1
  else
    echo "Skipping (no package.json)"
  fi
}

rebuild_node_modules() {
  local build_dir=${1:-}

  if [ -e $build_dir/package.json ]; then
    cd $build_dir
    # echo "Rebuilding any native modules"
    # npm rebuild 2>&1
    if [ -e $build_dir/npm-shrinkwrap.json ]; then
      echo "Installing any new modules (package.json + shrinkwrap)"
    else
      echo "Installing any new modules (package.json)"
    fi
    # npm install --unsafe-perm --userconfig $build_dir/.npmrc 2>&1
    npm install --global --unsafe-perm --userconfig $HOME/.npmrc 2>&1
  else
    echo "Skipping (no package.json)"
  fi
}
<commit_msg>buildpacks/nodejs: Revert global npm installation (did not work :cry:)<commit_after>install_node_modules() {
  local build_dir=${1:-}

  if [ -e $build_dir/package.json ]; then
    cd $build_dir
    echo "Pruning any extraneous modules"
    # npm prune --unsafe-perm --userconfig $build_dir/.npmrc 2>&1
    npm prune --unsafe-perm --userconfig $HOME/.npmrc 2>&1
    if [ -e $build_dir/npm-shrinkwrap.json ]; then
      echo "Installing node modules (package.json + shrinkwrap)"
    else
      echo "Installing node modules (package.json)"
    fi
    # npm install --unsafe-perm --userconfig $build_dir/.npmrc 2>&1
    npm install --unsafe-perm --userconfig $HOME/.npmrc 2>&1
  else
    echo "Skipping (no package.json)"
  fi
}

rebuild_node_modules() {
  local build_dir=${1:-}

  if [ -e $build_dir/package.json ]; then
    cd $build_dir
    # echo "Rebuilding any native modules"
    # npm rebuild 2>&1
    if [ -e $build_dir/npm-shrinkwrap.json ]; then
      echo "Installing any new modules (package.json + shrinkwrap)"
    else
      echo "Installing any new modules (package.json)"
    fi
    # npm install --unsafe-perm --userconfig $build_dir/.npmrc 2>&1
    npm install --unsafe-perm --userconfig $HOME/.npmrc 2>&1
  else
    echo "Skipping (no package.json)"
  fi
}

{'fraction_non_alphanumeric': 0.12972542777556706, 'fraction_numerical': 0.012733784321528054, 'mean_word_length': 2.8676923076923075, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6261106', 'n_tokens_mistral': 898, 'n_tokens_neox': 825, 'n_words': 240}