• Stars
    star
    168
  • Rank 225,507 (Top 5 %)
  • Language
    Shell
  • License
    MIT License
  • Created about 4 years ago
  • Updated about 1 month ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Node.js snap source and updater

Node.js Snap for https://snapcraft.io/

Get it from the Snap Store

Snaps are:

app packages for desktop, cloud and IoT that are easy to install, secure, cross‐platform and dependency‐free. Snaps are discoverable and installable from the Snap Store, the app store for Linux with an audience of millions.

The Snap managed from this repository is available as node from the Snap store and contains the Node.js runtime, along with the two most widely-used package managers, npm and Yarn. They are automatically built and pushed for each supported release line and nightly versions straight from the master branch. Once initially installed, new versions of Node.js for the release line you've chosen are automatically updated to your computer within hours of their release on nodejs.org.

Installation

The snap command ships with Ubuntu and is available to be installed in most popular Linux distributions. If you do not have it installed, follow the instructions on Snapcraft to install snapd.

Snaps are delivered via "channels". For Node.js, the channel names are the major-version number of Node.js. So select a supported Node.js version and install with:

sudo snap install node --classic --channel=14

Substituting 14 for the major version you want to install. Both LTS and Current versions of Node.js are available.

Once installed, the node, npm and yarn commands are available for use and will remain updated for the channel you selected.

The --classic argument is required here as Node.js needs full access to your system in order to be useful, therefore it needs Snap's "classic confinement". By default, Snaps are much more restricted in their ability to access your disk and network and must request special access from you where they need it.

Switching release lines

You can use the refresh command to switch to a new channel at any time:

sudo snap refresh node --channel=15

Once switched, snapd will update Node.js for the new channel you have selected.

Nightly ("edge") versions

The master branch from the Node.js git repository are pushed to the Snap store nightly and are available from the edge channel.

sudo snap install node --classic --channel=edge

How publishing happens

The pipeline from releases to the Snap store is complicated and involves many moving pieces. This repository serves as the connection between nodejs.org/download/, where releases are published, and the Canonical Snap toolchain that builds the snaps (Launchpad) and publishes them (Snapcraft).

Snap configuration

This repository contains a master script snapcraft.yaml.sh, and a Snap build definition file that it creates, snapcraft.yaml. snapcraft.yaml should never be edited manually, it is the product of the script.

This repository contains a branch for each track/channel published to the Snap store. The master branch represents the "edge" channel, while the nodeXX branches represent the major release lines (e.g. node14 for Node.js 14.x.x). These release lines are published to the "stable" channel on a track named after the release line. e.g. Node.js 14.x.x releases are published as 14/stable.

Each branch, contains both a snapcraft.yaml.sh script and a snapcraft.yaml definition file. These are different between releases as compile requirements change.

Changes to the build definition should be made in the snapcraft.yaml.sh script for the relevant branch. For changes to "edge" (nightly / master) releases, change the snapcraft.yaml.sh script on the master branch. For changes to the "14/stable" releases, change the snapcraft.yaml.sh on the node14 branch. All changes should be made via Pull Request targeting the appropriate branch.

Watching for releases

This repository uses GitHub Actions on a timer (cron) schedule. See .github/workflows/cron.yml. The Action configuration is set to run for the master branch and for each major release line that is currently being published to the Snap store using a matrix configuration.

Upon run, for each branch, this repository is cloned and the snapcraft.yaml.sh script is run with arguments that tell it what to do. -rXX is supplied to specify the release line (e.g. -r14, this is omitted for "edge" releases) and -gnode14 is supplied to specify the Git branch to operate on (more on this below).

The snapcraft.yaml.sh script will fetch the relevant releases list, either https://nodejs.org/download/release/index.tab for regular releases, or https://nodejs.org/download/nightly/index.tab for "edge" releases. The latest release for the given release line (or latest nightly release) is then used to build the snapcraft.yaml Snap definition file.

In most cases, building a new snapcraft.yaml file will result in the same file already in this repository. But when there is a new release for that release line, the file will differ. When it differs it is committed and pushed back to this repository on the appropriate branch.

When changes are made, the commit is also pushed to Launchpad to build the Snap.

Building Snaps

A mirror of this repository is maintained on Canonical's Launchpad at https://code.launchpad.net/node-snap. Launchpad has integration with the Snap store and has builders for many different platforms that can build Snap packages with minimal additional configuration.

When changes are made to the snapcraft.yaml file for each branch on this repository, the changes are also pushed to https://code.launchpad.net/node-snap for the same branch.

For each branch we are releasing to the Snap store, we have a Snap build configuration set up in Launchpad (the setup is a manual process for an authorized user at the beginning of each release line). Changes to the branch result in new Snap package builds from the snapcraft.yaml definition file. Once successfully built, the packages are pushed to the Snap store for the relevant track/channel.

Adding new release lines

The process for adding new release lines when the Node.js Release team begin one is a multi-step process, some of these steps can be contributed to this repository by anybody via Pull Request:

  1. Request a new Track for the "node" Snap in the Snapcraft forum in the "Store requests" section. The track should be the major release line number (e.g. 14). The "node" Snap has fast-track approval and is usually authorized within 24 hours by the administrators. This step needs to be performed in order to upload to a new track. An example of this for 14 can be seen here: https://forum.snapcraft.io/t/track-request-for-node-14-fast-track-please/16842/3
  2. Create a new branch in this repository, named nodeXX where XX is the release line number.
  3. Edit snapcraft.yaml.sh if required for system configuration required to build the new version. In most cases this is not necessary and the master version can be copied. Where the compiler minimums change, the equivalent changes may need to be made in the script.
  4. Edit .github/workflows/cron.yml to add the new release line to the matrix.
  5. Start a build (manually, or wait for the GitHub Action to trigger by cron), which will update the snapcraft.yaml file for that branch correctly and push the new branch to https://code.launchpad.net/node-snap where it can be further configured.
  6. Navigate to https://code.launchpad.net/node-snap and into the new branch and click on "Create snap package".
  • The "name" should be the same as the branch
  • The "series" should be inferred from snapcraft.yaml
  • The "processors" should be at least: armhf, arm64, amd64, i386
  • "Automatically build when branch changes" should be ticked.
  • "Automatically upload to store" should be ticked
  • "Registered store package name" should be "node"
  • "Risk" should be "stable" (this is "edge" for nightly builds)
  • "Track" should be the major release line
  • Clicking "Create snap package" should create the workflow and authenticate the publishing with the Snap store (this is a simple multi-step authorization process).
  1. Manually request new builds for the Snap from the Snap configuration page in Launchpad ("Request builds").

Note that at the time of writing, Snap store authorization for Launchpad has an expiry of 2 years. This can cause Snaps to fail to upload and may not result in a warning. This can be a problem for LTS lines.

Removing old release lines

When release lines stop seeing new releases, they can be removed from .github/workflows/cron.yml. This stops the entire pipeline from running (although changes to the relevant branch will not even occur without new releases on nodejs.org). The Snap configuration in Launchpad can also be removed but this is not strictly necessary.

Default release line

Snaps can have a "default" track. This default determines which track is installed if the user doesn't set one (e.g. with sudo snap install node). It is up to the Snap author to set this default and update it as appropriate. Users don't follow the default track, it only determines the starting track at time of install. Changing default in the Snap store doesn't impact existing users, only new installs

The Node.js Snap should have its "default" set to the most recent LTS. This can be done in the Releases page by a Node.js Snap administrator: https://snapcraft.io/node/releases and should be done as soon as a release line enters Active LTS as per the Release Schedule.

This is a manual procedure and may require reminders posted to this repository from the community.

More Repositories

1

node

Node.js JavaScript runtime ✨🐢🚀✨
JavaScript
97,973
star
2

node-v0.x-archive

Moved to https://github.com/nodejs/node
34,533
star
3

node-gyp

Node.js native addon build tool
Python
9,275
star
4

docker-node

Official Docker Image for Node.js 🐳 🐢 🚀
Dockerfile
7,872
star
5

http-parser

http request/response parser for c
C
6,223
star
6

undici

An HTTP/1.1 client, written from scratch for Node.js
JavaScript
6,182
star
7

nodejs.org

The Node.js® Website
TypeScript
6,020
star
8

Release

Node.js Release Working Group
3,803
star
9

nan

Native Abstractions for Node.js
C++
3,277
star
10

corepack

Zero-runtime-dependency package acting as bridge between Node projects and their package managers
TypeScript
2,542
star
11

node-addon-examples

Node.js C++ addon examples from http://nodejs.org/docs/latest/api/addons.html
C++
2,332
star
12

nodejs.dev

A redesign of Nodejs.org built using Gatsby.js with React.js, TypeScript, and Remark.
TypeScript
2,293
star
13

node-addon-api

Module for using Node-API from C++
C++
2,162
star
14

node-chakracore

Node.js on ChakraCore ✨🐢🚀✨
JavaScript
1,921
star
15

node-convergence-archive

Archive for node/io.js convergence work pre-3.0.0
JavaScript
1,837
star
16

llhttp

Port of http_parser to llparse
TypeScript
1,665
star
17

help

✨ Need help with Node.js? File an Issue here. 🚀
1,473
star
18

llnode

An lldb plugin for Node.js and V8, which enables inspection of JavaScript states for insights into Node.js processes and their core dumps.
C++
1,151
star
19

readable-stream

Node-core streams for userland
JavaScript
1,003
star
20

examples

A repository of runnable Node.js examples that go beyond "hello, world!"
JavaScript
652
star
21

TSC

The Node.js Technical Steering Committee
JavaScript
592
star
22

llparse

Generating parsers in LLVM IR
TypeScript
586
star
23

mentorship

Node.js Mentorship Program Initiative
585
star
24

citgm

Canary in the Gold Mine
JavaScript
567
star
25

http2

Working on an HTTP/2 implementation for Node.js Core
JavaScript
520
star
26

diagnostics

Node.js Diagnostics Working Group
513
star
27

security-wg

Node.js Ecosystem Security Working Group
JavaScript
495
star
28

next-10

Repository for discussion on strategic directions for next 10 years of Node.js
480
star
29

build

Better build and test infra for Node.
Shell
469
star
30

node-eps

Node.js Enhancement Proposals for discussion on future API additions/changes to Node core
442
star
31

education

A place to discover and contribute to education initiatives in Node.js
417
star
32

node-v8

Experimental Node.js mirror on V8 lkgr ✨🐢🚀✨
Shell
416
star
33

modules

Node.js Modules Team
413
star
34

package-maintenance

Repository for work for discussion of helping with maintenance of key packages in the ecosystem.
407
star
35

nodejs-zh-CN

node.js 中文化 & 中文社区
SCSS
395
star
36

performance

Node.js team focusing on performance
Shell
376
star
37

node-inspect

Code that's now part of node, previously `node debug` for `node --inspect`
JavaScript
340
star
38

node-report

Delivers a human-readable diagnostic summary, written to file.
C++
326
star
39

single-executable

This team aims to advance the state of the art in packaging Node.js applications as single standalone executables (SEAs) on all supported operating systems.
306
star
40

quic

This repository is no longer active.
JavaScript
301
star
41

github-bot

@nodejs-github-bot's heart and soul
JavaScript
267
star
42

community-committee

The Node.js Community Committee (aka CommComm)
263
star
43

nodejs-ko

node.js 한국 커뮤니티
Stylus
263
star
44

amaro

Node.js TypeScript wrapper
JavaScript
261
star
45

node-core-utils

CLI tools for Node.js Core collaborators
JavaScript
253
star
46

unofficial-builds

Unofficial binaries for Node.js
Shell
252
star
47

evangelism

Letting the world know how awesome Node.js is and how to get involved!
242
star
48

abi-stable-node

Repository used by the Node-API team to manage work related to Node-API and node-addon-api
JavaScript
241
star
49

abi-stable-node-addon-examples

Node Add-on Examples with PoC ABI stable API for native modules
C++
237
star
50

changelog-maker

A git log to CHANGELOG.md tool
JavaScript
230
star
51

uvwasi

WASI syscall API built atop libuv
C
228
star
52

cjs-module-lexer

Fast lexer to extract named exports via analysis from CommonJS modules
JavaScript
226
star
53

iojs.org

JavaScript
219
star
54

installer

Electron based installer for Node.js.
JavaScript
194
star
55

getting-started

Getting started in Node.js!
193
star
56

postject

Easily inject arbitrary read-only resources into executable formats (Mach-O, PE, ELF) and use it at runtime.
JavaScript
186
star
57

web-server-frameworks

A place for Node.js Web-Server Framework authors and users to collaborate
182
star
58

repl

REPL rewrite for Node.js ✨🐢🚀✨
JavaScript
178
star
59

tooling

Advancing Node.js as a framework for writing great tools
170
star
60

code-and-learn

A series of workshop sprints for Node.js.
Dockerfile
164
star
61

benchmarking

Node.js Benchmarking Working Group
Shell
161
star
62

admin

Administrative space for policies of the TSC
JavaScript
157
star
63

docker-iojs

Official Docker images from the io.js project
Shell
156
star
64

full-icu-npm

convenience loader for 'small-icu' node builds
JavaScript
152
star
65

i18n

The Node.js Internationalization Working Group – A Community Committee initiative.
150
star
66

roadmap

This repository and working group has been retired.
135
star
67

gyp-next

A fork of the GYP build system for use in the Node.js projects
Python
131
star
68

loaders

ECMAScript Modules Loaders
128
star
69

nodejs-pt

Internacionalização & tradução para português referente ao site nodejs.org
108
star
70

dev-policy

node-foundation dev policy **draft**
108
star
71

promises

Promises Working Group Repository
107
star
72

nodejs-zh-TW

Node.js zh-TW
CSS
107
star
73

NG

Next Generation JavaScript IO Platform
103
star
74

nodejs-ja

Node.js 日本語ローカリゼーション
101
star
75

nodejs.org-archive

[DEPRECATED] Website repository for the Node.js project
Nginx
101
star
76

website-redesign

Facilitating the redesign of the nodejs.org website
99
star
77

node-core-test

Node 18's node:test, as an npm package
JavaScript
95
star
78

worker

Figuring out native (Web?)Worker support for Node
JavaScript
87
star
79

post-mortem

This WG is in the process of being folded into the Diagnostics WG.
85
star
80

typescript

TypeScript support in Node.js core
83
star
81

inclusivity

Improving inclusivity in the node community
80
star
82

CTC

Node.js Core Technical Committee & Collaborators
80
star
83

nodejs-ru

Перевод io.js на русский язык
JavaScript
79
star
84

ecmascript-modules

A fork of Node.js to hash out ideas related to ESModules
JavaScript
73
star
85

docs

A place for documentation. (this repository is inactive)
71
star
86

webcrypto

This repository has been archived. The WebCrypto API has been implemented in recent versions of Node.js and does not require additional packages.
JavaScript
69
star
87

import-in-the-middle

Like `require-in-the-middle`, but for ESM import
JavaScript
67
star
88

automation

Better automation for the Node.js project
66
star
89

api

API WG
61
star
90

email

MX server management for iojs.org (and eventually nodejs.org)
JavaScript
60
star
91

user-feedback

Node.js User Feedback Initiative
56
star
92

loaders-test

Examples demonstrating the Node.js ECMAScript Modules Loaders API
JavaScript
54
star
93

core-validate-commit

Validate commit messages for Node.js core
JavaScript
52
star
94

board

The Node Foundation Board of Directors
JavaScript
52
star
95

branch-diff

A tool to list print the commits on one git branch that are not on another using loose comparison
JavaScript
52
star
96

logos

Logo ideas
51
star
97

promise-use-cases

Short lived repository in order to discuss Node.js promise use cases in Collaborator Summit Berlin 2018
JavaScript
50
star
98

open-standards

Node.js Open Standards Team
43
star
99

version-management

Discussion Group for Version Management
42
star
100

hardware

Hardware Working Group
42
star