Giter Site home page Giter Site logo

node-build-update-defs's Introduction

Seamlessly manage your app’s Node environment with nodenv.

Use nodenv to pick a Node version for your application and guarantee that your development environment matches production. Put nodenv to work with npm for painless Node upgrades and bulletproof deployments.

Powerful in development. Specify your app's Node version once, in a single file. Keep all your teammates on the same page. No headaches running apps on different versions of Node. Just Works™ from the command line. Override the Node version anytime: just set an environment variable.

Rock-solid in production. Your application's executables are its interface with ops. With nodenv and you'll never again need to cd in a cron job or Chef recipe to ensure you've selected the right runtime. The Node version dependency lives in one place—your app—so upgrades and rollbacks are atomic, even when you switch versions.

One thing well. nodenv is concerned solely with switching Node versions. It's simple and predictable. A rich plugin ecosystem lets you tailor it to suit your needs. Compile your own Node versions, or use the node-build plugin to automate the process. Specify per-application environment variables with nodenv-vars. See more plugins on the wiki.

Why choose nodenv?

Table of Contents

How It Works

At a high level, nodenv intercepts Node commands using shim executables injected into your PATH, determines which Node version has been specified by your application, and passes your commands along to the correct Node installation.

Understanding PATH

When you run a command like node or npm, your operating system searches through a list of directories to find an executable file with that name. This list of directories lives in an environment variable called PATH, with each directory in the list separated by a colon:

/usr/local/bin:/usr/bin:/bin

Directories in PATH are searched from left to right, so a matching executable in a directory at the beginning of the list takes precedence over another one at the end. In this example, the /usr/local/bin directory will be searched first, then /usr/bin, then /bin.

Understanding Shims

nodenv works by inserting a directory of shims at the front of your PATH:

~/.nodenv/shims:/usr/local/bin:/usr/bin:/bin

Through a process called rehashing, nodenv maintains shims in that directory to match every Node command across every installed version of Node—node, npm, and so on.

Shims are lightweight executables that simply pass your command along to nodenv. So with nodenv installed, when you run, say, npm, your operating system will do the following:

  • Search your PATH for an executable file named npm
  • Find the nodenv shim named npm at the beginning of your PATH
  • Run the shim named npm, which in turn passes the command along to nodenv

Choosing the Node Version

When you execute a shim, nodenv determines which Node version to use by reading it from the following sources, in this order:

  1. The NODENV_VERSION environment variable, if specified. You can use the nodenv shell command to set this environment variable in your current shell session.

  2. The first .node-version file found by searching the directory of the script you are executing and each of its parent directories until reaching the root of your filesystem.

  3. The first .node-version file found by searching the current working directory and each of its parent directories until reaching the root of your filesystem. You can modify the .node-version file in the current working directory with the nodenv local command.

  4. The global ~/.nodenv/version file. You can modify this file using the nodenv global command. If the global version file is not present, nodenv assumes you want to use the "system" Node—i.e. whatever version would be run if nodenv weren't in your path.

Locating the Node Installation

Once nodenv has determined which version of Node your application has specified, it passes the command along to the corresponding Node installation.

Each Node version is installed into its own directory under ~/.nodenv/versions. For example, you might have these versions installed:

  • ~/.nodenv/versions/0.10.36/
  • ~/.nodenv/versions/0.12.0/
  • ~/.nodenv/versions/iojs-1.0.0/

Version names to nodenv are simply the names of the directories or symlinks in ~/.nodenv/versions.

Installation

Using Package Managers

  1. Install nodenv using one of the following approaches.

    Homebrew

    On macOS or Linux, we recommend installing nodenv with Homebrew.

    brew install nodenv

    Debian, Ubuntu, and their derivatives

    Presently, nodenv is not available in the Debian or Ubuntu package repositories. Consider contributing!

    Arch Linux and its derivatives

    Archlinux has an AUR Package for nodenv and you can install it from the AUR using the instructions from this wiki page.

  2. Set up nodenv in your shell.

    nodenv init

    Follow the printed instructions to set up nodenv shell integration.

  3. Close your Terminal window and open a new one so your changes take effect.

  4. Verify that nodenv is properly set up using this nodenv-doctor script:

    curl -fsSL https://github.com/nodenv/nodenv-installer/raw/main/bin/nodenv-doctor | bash
    Checking for `nodenv' in PATH: /usr/local/bin/nodenv
    Checking for nodenv shims in PATH: OK
    Checking `nodenv install' support: /usr/local/bin/nodenv-install (node-build 3.0.22-4-g49c4cb9)
    Counting installed Node versions: none
      There aren't any Node versions installed under `~/.nodenv/versions'.
      You can install Node versions like so: nodenv install 2.2.4
    Auditing installed plugins: OK
  5. That's it! Installing nodenv includes node-build, so now you're ready to install some Node versions using nodenv install.

Basic GitHub Checkout

For a more automated install, you can use nodenv-installer. If you prefer a manual approach, follow the steps below.

This will get you going with the latest version of nodenv without needing a systemwide install.

  1. Clone nodenv into ~/.nodenv.

    git clone https://github.com/nodenv/nodenv.git ~/.nodenv

    Optionally, try to compile dynamic bash extension to speed up nodenv. Don't worry if it fails; nodenv will still work normally:

    cd ~/.nodenv && src/configure && make -C src
  2. Add ~/.nodenv/bin to your $PATH for access to the nodenv command-line utility.

    • For bash:

      Ubuntu Desktop users should configure ~/.bashrc:

      echo 'export PATH="$HOME/.nodenv/bin:$PATH"' >> ~/.bashrc

      On other platforms, bash is usually configured via ~/.bash_profile:

      echo 'export PATH="$HOME/.nodenv/bin:$PATH"' >> ~/.bash_profile
    • For Zsh:

      echo 'export PATH="$HOME/.nodenv/bin:$PATH"' >> ~/.zshrc
    • For Fish shell:

      set -Ux fish_user_paths $HOME/.nodenv/bin $fish_user_paths
  3. Set up nodenv in your shell.

    ~/.nodenv/bin/nodenv init

    Follow the printed instructions to set up nodenv shell integration.

  4. Restart your shell so that PATH changes take effect. (Opening a new terminal tab will usually do it.)

  5. Verify that nodenv is properly set up using this nodenv-doctor script:

    curl -fsSL https://github.com/nodenv/nodenv-installer/raw/main/bin/nodenv-doctor | bash
    Checking for `nodenv' in PATH: /usr/local/bin/nodenv
    Checking for nodenv shims in PATH: OK
    Checking `nodenv install' support: /usr/local/bin/nodenv-install (node-build 3.0.22-4-g49c4cb9)
    Counting installed Node versions: none
      There aren't any Node versions installed under `~/.nodenv/versions'.
      You can install Node versions like so: nodenv install 2.2.4
    Auditing installed plugins: OK
  6. (Optional) Install node-build, which provides the nodenv install command that simplifies the process of installing new Node versions.

Upgrading with Git

If you've installed nodenv manually using Git, you can upgrade to the latest version by pulling from GitHub:

cd ~/.nodenv
git pull

To use a specific release of nodenv, check out the corresponding tag:

$ cd ~/.nodenv
$ git fetch
$ git checkout v0.3.0

Alternatively, check out the nodenv-update plugin which provides a command to update nodenv along with all installed plugins.

$ nodenv update

Updating the list of available Node versions

If you're using the nodenv install command, then the list of available Node versions is not automatically updated when pulling from the nodenv repo. To do this manually:

cd ~/.nodenv/plugins/node-build
git pull

How nodenv hooks into your shell

Skip this section unless you must know what every line in your shell profile is doing.

nodenv init is the only command that crosses the line of loading extra commands into your shell. Here's what nodenv init actually does:

  1. Sets up your shims path. This is the only requirement for nodenv to function properly. You can do this by hand by prepending ~/.nodenv/shims to your $PATH.

  2. Installs autocompletion. This is entirely optional but pretty useful. Sourcing ~/.nodenv/completions/nodenv.bash will set that up. There is also a ~/.nodenv/completions/nodenv.zsh for Zsh users.

  3. Rehashes shims. From time to time you'll need to rebuild your shim files. Doing this automatically makes sure everything is up to date. You can always run nodenv rehash manually.

  4. Installs the sh dispatcher. This bit is also optional, but allows nodenv and plugins to change variables in your current shell, making commands like nodenv shell possible. The sh dispatcher doesn't do anything invasive like override cd or hack your shell prompt, but if for some reason you need nodenv to be a real script rather than a shell function, you can safely skip it.

Run nodenv init - for yourself to see exactly what happens under the hood.

Installing Node versions

The nodenv install command doesn't ship with nodenv out of the box, but is provided by the node-build project. If you installed it as part of GitHub checkout process outlined above you should be able to:

# list latest stable versions:
nodenv install -l

# list all local versions:
nodenv install -L

# install a Node version:
nodenv install 16.13.2

Set a Node version to finish installation and start using commands nodenv global 18.14.1 or nodenv local 18.14.1

Alternatively to the install command, you can download and compile Node manually as a subdirectory of ~/.nodenv/versions/. An entry in that directory can also be a symlink to a Node version installed elsewhere on the filesystem. nodenv doesn't care; it will simply treat any entry in the versions/ directory as a separate Node version. Additionally, nodenv has special support for an lts/ subdirectory inside versions/. This works great with the nodenv-aliases plugin, for example:

cd ~/.nodenv/versions
mkdir lts

# Create a symlink that allows to use "lts/erbium" as a nodenv version
# that always points to the latest Node 12 version that is installed.
ln -s ../12 lts/erbium

Uninstalling Node versions

As time goes on, Node versions you install will accumulate in your ~/.nodenv/versions directory.

To remove old Node versions, simply rm -rf the directory of the version you want to remove. You can find the directory of a particular Node version with the nodenv prefix command, e.g. nodenv prefix 0.8.22.

The node-build plugin provides an nodenv uninstall command to automate the removal process.

Uninstalling nodenv

The simplicity of nodenv makes it easy to temporarily disable it, or uninstall from the system.

  1. To disable nodenv managing your Node versions, simply remove the nodenv init line from your shell startup configuration. This will remove nodenv shims directory from $PATH, and future invocations like node will execute the system Node version, as before nodenv.

    While disabled, nodenv will still be accessible on the command line, but your Node apps won't be affected by version switching.

  2. To completely uninstall nodenv, perform step (1) and then remove its root directory. This will delete all Node versions that were installed under `nodenv root`/versions/ directory:

     rm -rf `nodenv root`
    

    If you've installed nodenv using a package manager, as a final step perform the nodenv package removal:

    • Homebrew: brew uninstall nodenv
    • Archlinux and its derivatives: sudo pacman -R nodenv

Command Reference

Like git, the nodenv command delegates to subcommands based on its first argument. The most common subcommands are:

nodenv local

Sets a local application-specific Node version by writing the version name to a .node-version file in the current directory. This version overrides the global version, and can be overridden itself by setting the NODENV_VERSION environment variable or with the nodenv shell command.

nodenv local 0.10.0

When run without a version number, nodenv local reports the currently configured local version. You can also unset the local version:

nodenv local --unset

nodenv global

Sets the global version of Node to be used in all shells by writing the version name to the ~/.nodenv/version file. This version can be overridden by an application-specific .node-version file, or by setting the NODENV_VERSION environment variable.

nodenv global 0.10.26

The special version name system tells nodenv to use the system Node (detected by searching your $PATH).

When run without a version number, nodenv global reports the currently configured global version.

nodenv shell

Sets a shell-specific Node version by setting the NODENV_VERSION environment variable in your shell. This version overrides application-specific versions and the global version.

nodenv shell 0.11.11

When run without a version number, nodenv shell reports the current value of NODENV_VERSION. You can also unset the shell version:

nodenv shell --unset

Note that you'll need nodenv's shell integration enabled (step 3 of the installation instructions) in order to use this command. If you prefer not to use shell integration, you may simply set the NODENV_VERSION variable yourself:

export NODENV_VERSION=0.10.26

nodenv versions

Lists all Node versions known to nodenv, and shows an asterisk next to the currently active version.

$ nodenv versions
  0.8.22
  0.9.12
  * 0.10.0 (set by /Users/will/.nodenv/version)

This will also list symlinks to specific Node versions inside the ~/.nodenv/versions or ~/.nodenv/versions/lts directories.

nodenv version

Displays the currently active Node version, along with information on how it was set.

$ nodenv version
0.10.0 (set by /Users/OiNutter/.nodenv/version)

nodenv rehash

Installs shims for all Node executables known to nodenv (i.e., ~/.nodenv/versions/*/bin/* and ~/.nodenv/versions/lts/*/bin/*). Run this command after you install a new version of Node, or install an npm package that provides an executable binary.

$ nodenv rehash

note: the package-rehash plugin automatically runs nodenv rehash whenever an npm package is installed globally

nodenv which

Displays the full path to the executable that nodenv will invoke when you run the given command.

$ nodenv which npm
/Users/will/.nodenv/versions/0.10.26/bin/npm

nodenv whence

Lists all Node versions with the given command installed.

$ nodenv whence npm
0.10.0
0.9.12
0.8.22

Environment variables

You can affect how nodenv operates with the following settings:

name default description
NODENV_VERSION Specifies the Node version to be used.
Also see nodenv shell
NODENV_ROOT ~/.nodenv Defines the directory under which Node versions and shims reside.
Also see nodenv root
NODENV_DEBUG Outputs debug information.
Also as: nodenv --debug <subcommand>
NODENV_HOOK_PATH see wiki Colon-separated list of paths searched for nodenv hooks.
NODENV_DIR $PWD Directory to start searching for .node-version files.

Development

The nodenv source code is hosted on GitHub. It's clean, modular, and easy to understand, even if you're not a shell hacker.

Tests are executed using Bats:

$ bats test
$ bats test/<file>.bats

Please feel free to submit pull requests and file bugs on the issue tracker.

Credits

Forked from Sam Stephenson's rbenv by Will McKenzie and modified for node.

node-build-update-defs's People

Contributors

dependabot[bot] avatar jasonkarns avatar toc-me[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

node-build-update-defs's Issues

Scraper includes `headers` in build def output

Build definition for 8.0.0-rc.1:

binary aix-ppc64 "https://nodejs.org/download/rc/v8.0.0-rc.1/node-v8.0.0-rc.1-aix-ppc64.tar.gz#aca8e5b1d27b22b169e6d1366ba7f77ecd46225913c8fce86aa5dbf3b18233d3"
binary darwin-x64 "https://nodejs.org/download/rc/v8.0.0-rc.1/node-v8.0.0-rc.1-darwin-x64.tar.gz#1fca889104db285d068b98a827ed6fc2b1aa4cd55c3c48eb74556be66b6d4774"
binary rc.1-headers "https://nodejs.org/download/rc/v8.0.0/node-v8.0.0-rc.1-headers.tar.gz#79ed89f4c73ba1607fc24dc157efe00e65d60cdefd6976460695d3a2b9b2c146"
binary linux-arm64 "https://nodejs.org/download/rc/v8.0.0-rc.1/node-v8.0.0-rc.1-linux-arm64.tar.gz#700a9619effd07faf939d5f9627810c4cb0e0b71273ce5d7dc5e3a1c4f766e74"
binary linux-armv6l "https://nodejs.org/download/rc/v8.0.0-rc.1/node-v8.0.0-rc.1-linux-armv6l.tar.gz#ca2ce9cce0c148b2dbc73f0b7437c79561ebf52f532a7489edddcb178821be86"
binary linux-armv7l "https://nodejs.org/download/rc/v8.0.0-rc.1/node-v8.0.0-rc.1-linux-armv7l.tar.gz#b29cfe1276f4d8dddfa6e346cfb513cd0406ec4e485eb42f205d630e6c09f352"
binary linux-ppc64le "https://nodejs.org/download/rc/v8.0.0-rc.1/node-v8.0.0-rc.1-linux-ppc64le.tar.gz#d43f2c15abe9739e41f7629308c19344e7bb8142626f8f89d7ec32746b951cf7"
binary linux-ppc64 "https://nodejs.org/download/rc/v8.0.0-rc.1/node-v8.0.0-rc.1-linux-ppc64.tar.gz#dd946c18916fbba388cdcdfcd64013c9560c7357ee58ddd031cf20b42e666a43"
binary linux-s390x "https://nodejs.org/download/rc/v8.0.0-rc.1/node-v8.0.0-rc.1-linux-s390x.tar.gz#cc0a49f49f8357b398690e7c7624de5a7b649ec5c5da53d120881cc9c78582d4"
binary linux-x64 "https://nodejs.org/download/rc/v8.0.0-rc.1/node-v8.0.0-rc.1-linux-x64.tar.gz#50850e5b2cba4f70f0bc737e634accd541ff76d4e4f05a4924eb475196c9ccdd"
binary linux-x86 "https://nodejs.org/download/rc/v8.0.0-rc.1/node-v8.0.0-rc.1-linux-x86.tar.gz#99c3bc79e4ac17e3aa1129d33e523ea144819b21cc90b6de71685f5ce6751641"
binary sunos-x64 "https://nodejs.org/download/rc/v8.0.0-rc.1/node-v8.0.0-rc.1-sunos-x64.tar.gz#3b717299a04f906c18c61b05567b78f61f8b35ab54cd044db4d5deb4f0af7e20"
binary sunos-x86 "https://nodejs.org/download/rc/v8.0.0-rc.1/node-v8.0.0-rc.1-sunos-x86.tar.gz#df38ffa9fcc2a1885a115efd343a628f7de639df7443608a23b2a4061b6411c6"

install_package "node-v8.0.0-rc.1" "https://nodejs.org/download/rc/v8.0.0-rc.1/node-v8.0.0-rc.1.tar.gz#82f2ac614a1514308417fe890abfd175e178164adc49920b0667fccabe7e27b5"

includes: binary rc.1-headers "https://nodejs.org/download/rc/v8.0.0/node-v8.0.0-rc.1-headers.tar.gz#79ed89f4c73ba1607fc24dc157efe00e65d60cdefd6976460695d3a2b9b2c146" when it should not.

Homebrew install doesn't seem to work

With a fresh install of node-build-update-defs from Homebrew, I get this error when trying to run nodenv update-version-defs:

© nodenv update-version-defs                                         
internal/modules/cjs/loader.js:626
    throw err;
    ^

Error: Cannot find module './lib/definition-file'
Require stack:
- /usr/local/Cellar/node-build-update-defs/2.9.1/index.js
- /usr/local/Cellar/node-build-update-defs/2.9.1/[stdin]
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:623:15)
    at Function.Module._load (internal/modules/cjs/loader.js:527:27)
    at Module.require (internal/modules/cjs/loader.js:681:19)
    at require (internal/modules/cjs/helpers.js:16:16)
    at Object.<anonymous> (/usr/local/Cellar/node-build-update-defs/2.9.1/index.js:1:24)
    at Module._compile (internal/modules/cjs/loader.js:774:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:785:10)
    at Module.load (internal/modules/cjs/loader.js:641:32)
    at Function.Module._load (internal/modules/cjs/loader.js:556:12)
    at Module.require (internal/modules/cjs/loader.js:681:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/usr/local/Cellar/node-build-update-defs/2.9.1/index.js',
    '/usr/local/Cellar/node-build-update-defs/2.9.1/[stdin]'
  ]
}
  • Homebrew 2.1.7-12-g74920d9
  • nodenv 1.3.0
  • node-build-update-defs 2.9.1
$ echo $NODE_BUILD_DEFINITIONS
/usr/local/opt/node-build-update-defs/share/node-build

Might be related to #9.

From what I can tell in #9, it looks like a Homebrew directive was added to do a rewrite of "lib" to "src" in order to satisfy Homebrew's somewhat reserved meaning of "lib". I checked the locally installed files and index.js indeed still uses the lib prefix, yet there is no lib directory present (but src is there).

Manually editing index.js to use src instead of lib fixes the issue. I'm not blocked by it, but will need to repeat the edits if I am to reinstall or upgrade this package. I am unfamiliar with the inner workings of Homebrew, but I suspect something about their replacement mechanism has either changed or it is no longer honored?

When doing a reinstall, this is the dump I saw:

✎ brew reinstall nodenv/nodenv/node-build-update-defs
==> Reinstalling nodenv/nodenv/node-build-update-defs 
==> Downloading https://github.com/nodenv/node-build-update-defs/archive/v2.9.1.tar.gz
Already downloaded: /Users/logan/Library/Caches/Homebrew/downloads/bf5ad909eeb49a38b35ee3823ed57f8c753f4580fb8018be184a355df0e3e69f--node-build-update-defs-2.9.1.tar.gz
==> Caveats
For `node-build`/`nodenv install` to pick up definitions written by this plugin,
ensure directory exists in NODE_BUILD_DEFINITIONS:
    export NODE_BUILD_DEFINITIONS="/usr/local/opt/node-build-update-defs/share/node-build"
==> Summary
🍺  /usr/local/Cellar/node-build-update-defs/2.9.1: 22 files, 132.5KB, built in 3 seconds

Thanks for maintaining this project!

Can't find scraped defs

Hello,

I'm trying to install Node 12.18.0 on my system, but I can't get the tools to actually find the version.

Using nodenv install -list shows me the that 12.16.3 is the final version for me. So I looked up the documentation on how to get the most recent versions.
I've upgraded nodenv and node-build using Homebrew, and they are on the latest version.

When I ran nodenv update-version-defs I can see in the output it wrote the defintions for 12.18.0, but I still cannot install it, the install command keeps telling me it can't find the version and that I should upgrade

brew update && brew upgrade node-build
Updated 1 tap (homebrew/cask).
==> Updated Casks
rubymine
Updating Homebrew...
Warning: node-build 4.8.3 already installed
nodenv install 12.18.0                
node-build: definition not found: 12.18.0

See all available versions with `nodenv install --list'.

If the version you need is missing, try upgrading node-build:

  brew update && brew upgrade node-build
nodenv update-version-defs            
nodenv: version `12.18.0' is not installed (set by /Users/olivar/RubymineProjects/customink-for-business/.node-version)

Tag first release

Want to tag a release so I can move this from homebrew-nodenv-head-only to homebrew-nodenv?

Support authenticated listings

Need to support Authentication of some sort. This would allow github scraping in particular to extend the rate-limit or provide unlimited requests.

--prune

Should support pruning/cleanup so that node-build defs take precedence when they are shipped. Should just remove any duplicates from plugin dir that exist elsewhere in NODE_BUILD_DEFINITIONS

Homebrew doesn't like installing JS files in "lib"

$ brew install nodenv/nodenv/node-build-update-defs
==> Installing node-build-update-defs from nodenv/nodenv
==> Downloading https://github.com/nodenv/node-build-update-defs/archive/v2.0.0.tar.gz
==> Downloading from https://codeload.github.com/nodenv/node-build-update-defs/tar.gz/v2.0.0
######################################################################## 100.0%
🍺  /usr/local/Cellar/node-build-update-defs/2.0.0: 13 files, 17.2K, built in 0 seconds

$ brew audit nodenv/nodenv/node-build-update-defs
nodenv/nodenv/node-build-update-defs:
 * Non-libraries were installed to "/usr/local/Cellar/node-build-update-defs/2.0.0/lib"
Installing non-libraries to "lib" is discouraged.
The offending files are:
  /usr/local/Cellar/node-build-update-defs/2.0.0/lib/build-node.js
  /usr/local/Cellar/node-build-update-defs/2.0.0/lib/build.js
  /usr/local/Cellar/node-build-update-defs/2.0.0/lib/fetch.js
  /usr/local/Cellar/node-build-update-defs/2.0.0/lib/scraper-nodejs.js
  /usr/local/Cellar/node-build-update-defs/2.0.0/lib/scraper.js

Error: 1 problem in 1 formula

We could move those files to libexec, but that's usually reserved for executables that aren't intended to be run directly by the user. Maybe src or js?

Merge definitions from different sources (or support musl libc pre-compiled binaries)

Currently, node-build only supports installing a bare version from a single source (nodejs official dist). Different variants or branches need to be prefixed. For example, installing a release-candidate version would be something like node-build v14.0.0-rc1 instead of node-build v14.0.0. This makes sense for variants where the binary is a completely different premise (like the graalvm and chakracore branches) or if it's on an unstable release (nightly/rc).

Unnoficial builds, however, have feature parity and the same release cycle as the main stable branch but are compiled for not-so-popular distros/architectures (musl libc, x86 and armv6). My idea is to make these work with bare versions. Running node-build 14.0.0 on a muslc system would download a binary from https://unofficial-builds.nodejs.org/download/release/, and when installing from an officially supported system, it would download binaries from the default https://nodejs.org/dist/

For that idea to work, we would need to add new logic to handle multiple mirror URLs in a single scrapper or logic for merging two scrapper results in a single one. The definition file would then contains binaries from all the different architectures present in all mirrors.

I can give a shot at the implementation, but I need some confirmation if the idea is in the right direction

Bug with 6.0.0 or 6.11.0

Error: bad checksum data
    at sourcePackage (/usr/local/var/nodenv/plugins/node-build-update-defs/lib/build-node.js:60:13)
    at Object.<anonymous> (/usr/local/var/nodenv/plugins/node-build-update-defs/lib/build-node.js:28:31)
    at process._tickCallback (internal/process/next_tick.js:109:7)

Missing version blocks updating defs

When working on a project which specifies a version of node which isn't installed, you cannot update version defs while in the project folder. The cli complains that the version isn't installed and quits if you try to update defs.

Is there a way to get around this so that we can update defs while in the project tree so a new version can be installed which wasn't previously known to nodenv?

Include a little more information on usage in the README

So, node-build from the homebrew-nodenv tap hasn't yet been updated to 8.6.0:

❯ System refresh-zsh* ⟰  brew update && brew upgrade node-build
Already up-to-date.
Error: node-build 2.6.13 already installed

Looking through nodenv plugins, I saw I'd already installed node-build-update-defs, so I tried that:

❯ System refresh-zsh* ⟰  [34s] nodenv update-version-defs
Checking for new nodejs versions
Checking for new nodejs release candidate versions
6.11.3 written
----8<----8<----
8.6.0 written

Unfortunately, that doesn't seem to have changed my ability to install 8.6.0:

❯ System refresh-zsh* ⟰  [12s] nodenv install 8.6.0
node-build: definition not found: 8.6.0

See all available versions with `nodenv install --list'.

If the version you need is missing, try upgrading node-build:

  brew update && brew upgrade node-build
nodenv: version `8.6.0' not installed
mkdir: /lib/node_modules/.hooks: Permission denied

I'm sure I can hunt down how to get this to work; but a glance at the README yields no information about how to use nodenv update-version-defs; I figure this is something that belongs in a README! (=

Hope this was helpful.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.