1 Star 0 Fork 1

Gitee Go / asdf-nodejs

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

asdf-nodejs

Build Status

Node.js plugin for asdf version manager

Install

After installing asdf, install the plugin by running:

asdf plugin add nodejs https://github.com/asdf-vm/asdf-nodejs.git

Use

Check asdf readme for instructions on how to install & manage versions of Node.js at a system and project level.

Behind the scenes, asdf-nodejs utilizes node-build to install pre-compiled binaries and compile from source if necessary. You can check its README for additional settings and some troubleshooting.

When compiling a version from source, you are going to need to install all requirements for compiling Node.js (be advised that different versions might require different configurations). That being said, node-build does a great job at handling edge cases and compilations rarely need a deep investigation.

Configuration

node-build already has a handful of settings, in additional to that asdf-nodejs has a few extra configuration variables:

  • ASDF_NODEJS_NODEBUILD_HOME: Home for the node-build installation, defaults to $ASDF_DIR/plugins/nodejs/.node-build, you can install it in another place or share it with your system
  • ASDF_NODEJS_NODEBUILD: Path to the node-build executable, defaults to $NODE_BUILD_MIRROR_URL/bin/node-build
  • ASDF_NODEJS_CONCURRENCY: How many jobs should be used in compilation. Defaults to half the computer cores
  • ASDF_NODEJS_VERBOSE_INSTALL: Enables verbose output for downloading and building. Any value different from empty is treated as enabled.
  • NODEJS_ORG_MIRROR: (Legacy) overrides the default mirror used for downloading the distibutions, alternative to the NODE_BUILD_MIRROR_URL node-build env var

Integrity/signature check

In the past asdf-nodejs checked for signatures and integrity by querying live keyservers. node-build, on the other hand, checks integrity by precomputing checksums ahead of time and versioning them together with the instructions for building them, making the process a lot more streamlined.

.nvmrc and .node-version support

asdf uses a .tool-versions file for auto-switching between software versions. To ease migration, you can have it read an existing .nvmrc or .node-version file to find out what version of Node.js should be used. To do this, add the following to $HOME/.asdfrc:

legacy_version_file = yes

Running the wrapped node-build command

We provide a command for running the installed node-build command:

asdf nodejs nodebuild --version

node-build advanced variations

node-build has some additional variations aside from the versions listed in asdf list-all nodejs (chakracore/graalvm branches and some others). As of now, we weakly support these variations. In the sense that they are available for install and can be used in a .tool-versions file, but we don't list them as installation candidates nor give them full attention.

Some of them will work out of the box, and some will need a bit of investigation to get them built. We are planning in providing better support for these variations in the future.

To list all the available variations run:

asdf nodejs nodebuild --definitions

Note that this command only lists the current node-build definitions. You might want to update the local node-build repository before listing them.

Manually updating node-build definitions

Every new node version needs to have a definition file in the node-build repository. asdf-nodejs already tries to update node-build on every new version installation, but if you want to update node-build manually for some reason we provide a command just for that:

asdf nodejs update-nodebuild

Default npm Packages

asdf-nodejs can automatically install a set of default set of npm package right after installing a Node.js version. To enable this feature, provide a $HOME/.default-npm-packages file that lists one package per line, for example:

lodash
request
express

You can specify a non-default location of this file by setting a ASDF_NPM_DEFAULT_PACKAGES_FILE variable.

The MIT License (MIT) Copyright (C) 2015-2017 Akash Manohar J Copyright (C) 2017 Robin Schneider <ypid@riseup.net> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

暂无描述 展开 收起
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/gitee-go/asdf-nodejs.git
git@gitee.com:gitee-go/asdf-nodejs.git
gitee-go
asdf-nodejs
asdf-nodejs
master

搜索帮助