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 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` 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/",