Update to node 14

This commit is contained in:
Felipe Lalanne 2023-01-03 13:02:35 -03:00
parent 578de7bcd4
commit b11c7157d3
8 changed files with 29 additions and 22 deletions

View File

@ -15,8 +15,7 @@ inputs:
default: "accounts+apple@balena.io" default: "accounts+apple@balena.io"
NODE_VERSION: NODE_VERSION:
type: string type: string
# FIXME: (please) https://github.com/balena-io/balena-cli/issues/2165 default: "14.x"
default: "12.x"
VERBOSE: VERBOSE:
type: string type: string
default: "true" default: "true"

View File

@ -12,8 +12,7 @@ inputs:
# --- custom environment # --- custom environment
NODE_VERSION: NODE_VERSION:
type: string type: string
# FIXME: (please) https://github.com/balena-io/balena-cli/issues/2165 default: "14.x"
default: "12.x"
VERBOSE: VERBOSE:
type: string type: string
default: "true" default: "true"

View File

@ -78,8 +78,8 @@ If you are a Node.js developer, you may wish to install the balena CLI via [npm]
The npm installation involves building native (platform-specific) binary modules, which require The npm installation involves building native (platform-specific) binary modules, which require
some development tools to be installed first, as follows. some development tools to be installed first, as follows.
> **The balena CLI currently requires Node.js version 12 (min 12.8.0).** > **The balena CLI currently requires Node.js version 14.**
> **Versions 13 and later are not yet fully supported.** > **Versions 15 and later are not yet fully supported.**
### Install development tools ### Install development tools
@ -89,7 +89,7 @@ some development tools to be installed first, as follows.
$ sudo apt-get update && sudo apt-get -y install curl python3 git make g++ $ sudo apt-get update && sudo apt-get -y install curl python3 git make g++
$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash $ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
$ . ~/.bashrc $ . ~/.bashrc
$ nvm install 12 $ nvm install 14
``` ```
The `curl` command line above uses The `curl` command line above uses
@ -106,14 +106,14 @@ recommended.
```sh ```sh
$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash $ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
$ . ~/.bashrc $ . ~/.bashrc
$ nvm install 12 $ nvm install 14
``` ```
#### **Windows** (not WSL) #### **Windows** (not WSL)
Install: Install:
* Node.js v12 from the [Nodejs.org releases page](https://nodejs.org/en/download/releases/). * Node.js v14 from the [Nodejs.org releases page](https://nodejs.org/en/download/releases/).
* If you'd like the ability to switch between Node.js versions, install * If you'd like the ability to switch between Node.js versions, install
[nvm-windows](https://github.com/coreybutler/nvm-windows#node-version-manager-nvm-for-windows) [nvm-windows](https://github.com/coreybutler/nvm-windows#node-version-manager-nvm-for-windows)
instead. instead.

View File

@ -151,11 +151,12 @@ export async function runRemoteCommand({
let exitCode: number | undefined; let exitCode: number | undefined;
let exitSignal: NodeJS.Signals | undefined; let exitSignal: NodeJS.Signals | undefined;
try { try {
[exitCode, exitSignal] = await new Promise<[number, NodeJS.Signals]>( [exitCode, exitSignal] = await new Promise((resolve, reject) => {
(resolve, reject) => {
const ps = spawn(program, args, { stdio }) const ps = spawn(program, args, { stdio })
.on('error', reject) .on('error', reject)
.on('close', (code, signal) => resolve([code, signal])); .on('close', (code, signal) =>
resolve([code ?? undefined, signal ?? undefined]),
);
if (ps.stdin && stdin && typeof stdin !== 'string') { if (ps.stdin && stdin && typeof stdin !== 'string') {
stdin.pipe(ps.stdin); stdin.pipe(ps.stdin);

14
npm-shrinkwrap.json generated
View File

@ -1421,6 +1421,14 @@
"tslint-no-unused-expression-chai": "^0.1.4", "tslint-no-unused-expression-chai": "^0.1.4",
"typescript": "^4.2.4", "typescript": "^4.2.4",
"yargs": "^16.2.0" "yargs": "^16.2.0"
},
"dependencies": {
"@types/node": {
"version": "12.20.55",
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.55.tgz",
"integrity": "sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==",
"dev": true
}
} }
}, },
"@balena/node-beaglebone-usbboot": { "@balena/node-beaglebone-usbboot": {
@ -2888,9 +2896,9 @@
} }
}, },
"@types/node": { "@types/node": {
"version": "12.20.42", "version": "14.18.36",
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.42.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.36.tgz",
"integrity": "sha512-aI3/oo5DzyiI5R/xAhxxRzfZlWlsbbqdgxfTPkqu/Zt+23GXiJvMCyPJT4+xKSXOnLqoL8jJYMLTwvK2M3a5hw==" "integrity": "sha512-FXKWbsJ6a1hIrRxv+FoukuHnGTgEzKYGi7kilfMae96AL9UNkPFNWJEEYWzdRI9ooIkbr4AKldyuSTLql06vLQ=="
}, },
"@types/node-cleanup": { "@types/node-cleanup": {
"version": "2.1.2", "version": "2.1.2",

View File

@ -89,7 +89,7 @@
"author": "Balena Inc. (https://balena.io/)", "author": "Balena Inc. (https://balena.io/)",
"license": "Apache-2.0", "license": "Apache-2.0",
"engines": { "engines": {
"node": ">=12 <16" "node": ">=14 <16"
}, },
"husky": { "husky": {
"hooks": { "hooks": {
@ -145,7 +145,7 @@
"@types/ndjson": "^2.0.1", "@types/ndjson": "^2.0.1",
"@types/net-keepalive": "^0.4.1", "@types/net-keepalive": "^0.4.1",
"@types/nock": "^11.1.0", "@types/nock": "^11.1.0",
"@types/node": "^12.20.42", "@types/node": "^14.18.36",
"@types/node-cleanup": "^2.1.2", "@types/node-cleanup": "^2.1.2",
"@types/parse-link-header": "^1.0.1", "@types/parse-link-header": "^1.0.1",
"@types/prettyjson": "^0.0.30", "@types/prettyjson": "^0.0.30",

View File

@ -178,7 +178,7 @@ async function startMockSshServer(): Promise<[Server, number]> {
}); });
return await new Promise<[Server, number]>((resolve, reject) => { return await new Promise<[Server, number]>((resolve, reject) => {
// TODO: remove 'as any' below. According to @types/node v12.20.42, the // TODO: remove 'as any' below. According to @types/node v14.18.36, the
// callback type is `() => void`, but our code assumes `(err: Error) => void` // callback type is `() => void`, but our code assumes `(err: Error) => void`
const listener = (server.listen as any)(0, '127.0.0.1', (err: Error) => { const listener = (server.listen as any)(0, '127.0.0.1', (err: Error) => {
// this callback is called for the 'listening' event // this callback is called for the 'listening' event

View File

@ -113,7 +113,7 @@ async function createProxyServer(): Promise<[number, number]> {
let proxyPort = 0; // TCP port number, 0 means automatic allocation let proxyPort = 0; // TCP port number, 0 means automatic allocation
await new Promise<void>((resolve, reject) => { await new Promise<void>((resolve, reject) => {
// TODO: remove 'as any' below. According to @types/node v12.20.42, the // TODO: remove 'as any' below. According to @types/node v14.18.36, the
// callback type is `() => void`, but our code assumes `(err: Error) => void` // callback type is `() => void`, but our code assumes `(err: Error) => void`
const listener = (server.listen as any)(0, '127.0.0.1', (err: Error) => { const listener = (server.listen as any)(0, '127.0.0.1', (err: Error) => {
if (err) { if (err) {
@ -197,7 +197,7 @@ async function createInterceptorServer(): Promise<number> {
let interceptorPort = 0; let interceptorPort = 0;
await new Promise<void>((resolve, reject) => { await new Promise<void>((resolve, reject) => {
// TODO: remove 'as any' below. According to @types/node v12.20.42, the // TODO: remove 'as any' below. According to @types/node v14.18.36, the
// callback type is `() => void`, but our code assumes `(err: Error) => void` // callback type is `() => void`, but our code assumes `(err: Error) => void`
const listener = (server.listen as any)(0, '127.0.0.1', (err: Error) => { const listener = (server.listen as any)(0, '127.0.0.1', (err: Error) => {
if (err) { if (err) {