From e27286786a991387beae7bbe6ef2d6829aad3596 Mon Sep 17 00:00:00 2001 From: Darcy Parker Date: Tue, 20 Jul 2021 09:43:51 -0400 Subject: [PATCH 1/3] .node-version and .nvmrc: Add .node-version file for use with node.js version mangers * See https://github.com/shadowspawn/node-version-usage * Note .nvmrc is a symbolic link to .node-version and works with nvmrc given it honors .node-version specification. Just don't use .nvmrc specific features in .node-version file. --- .node-version | 1 + .nvmrc | 1 + 2 files changed, 2 insertions(+) create mode 100644 .node-version create mode 120000 .nvmrc diff --git a/.node-version b/.node-version new file mode 100644 index 000000000..eccaa1afe --- /dev/null +++ b/.node-version @@ -0,0 +1 @@ +v12.18.2 diff --git a/.nvmrc b/.nvmrc new file mode 120000 index 000000000..070266a26 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +.node-version \ No newline at end of file From 649f8206f1d49b6470400489230ce11065b4fe0c Mon Sep 17 00:00:00 2001 From: Darcy Parker Date: Tue, 20 Jul 2021 09:47:52 -0400 Subject: [PATCH 2/3] package.json: Update node version in engines definition. particle-cli uses v12 as described in README.md --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index eb08d7245..48c1e4cc7 100644 --- a/package.json +++ b/package.json @@ -106,7 +106,7 @@ "serialport": "^8.0.5" }, "engines": { - "node": ">=8", + "node": "=12", "npm": ">=6" }, "homepage": "https://github.com/particle-iot/particle-cli/", From fe7a35eef60436e31316a13d14fd894115c67db0 Mon Sep 17 00:00:00 2001 From: Darcy Parker Date: Tue, 20 Jul 2021 09:48:36 -0400 Subject: [PATCH 3/3] README.md: Add important instructions to successfully install particle-cli on some architectures/environments --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index f33e0b1cb..9a76966d7 100644 --- a/README.md +++ b/README.md @@ -93,6 +93,20 @@ For the full list of commands, please see the [CLI command reference](https://do 1. Install Node.js [`node@12.x` and `npm@6.x` are required] 1. Clone this repository `$ git clone git@github.com:particle-iot/particle-cli.git && cd ./particle-cli` +1. Install dependencies required by some of particle-cli's npm dependencies + + > particle-cli uses npm packages [`node-usb`](https://github.com/tessel/node-usb) and [`node-serialport`](https://github.com/serialport/node-serialport). + > On some environments (ie: Raspberry Pi and Apple M1), `node-serialport` [does not provide prebuild environments](https://github.com/serialport/node-serialport/issues/2292), + > so their npm install script relies on creating a prebuild using node-gyp (See + > [node-gyp requirements](https://github.com/nodejs/node-gyp#on-unix)), and libudev (See [node-usb installation](https://github.com/tessel/node-usb#installation). + > And these must be installed in order for their npm install script to succeed. As well, particle-cli uses dfu-util and openssl. + > + > As an example, to install these dependencies on Raspbian/Debian/Ubuntu: + > ```bash + > sudo apt update && sudo apt upgrade + > sudo apt install build-essential libudev-dev python3 dfu-util openssl + > ``` + 1. Install dependencies `$ npm install` 1. View available commands `$ npm run` 1. Run the tests `$ npm test`