diff --git a/.travis.yml b/.travis.yml index 7d7721cc7..8f69d8d1d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,7 @@ services: - docker node_js: - - "8" + - "10" install: - npm install diff --git a/docker/Dockerfile.amd64 b/docker/Dockerfile.amd64 index 585b45176..0e5d4a0e4 100644 --- a/docker/Dockerfile.amd64 +++ b/docker/Dockerfile.amd64 @@ -1,4 +1,4 @@ -FROM alpine:3.7 +FROM alpine:3.8 # Copy files ADD . /app @@ -12,7 +12,7 @@ ARG COMMIT RUN echo "{\"hash\": \"$COMMIT\"}" > .hash.json # Install dependencies -RUN apk add --update --no-cache make gcc g++ python linux-headers udev nodejs git && \ +RUN apk add --update --no-cache make gcc g++ python linux-headers udev nodejs=8.11.4-r0 git && \ npm install --unsafe-perm && \ apk del make gcc g++ python linux-headers udev git diff --git a/docker/Dockerfile.arm32v6 b/docker/Dockerfile.arm32v6 index 8df81ebad..e97862749 100644 --- a/docker/Dockerfile.arm32v6 +++ b/docker/Dockerfile.arm32v6 @@ -1,4 +1,4 @@ -FROM arm32v6/alpine:3.7 +FROM arm32v6/alpine:3.8 # Setup cross-build ENV QEMU_EXECVE 1 @@ -14,7 +14,7 @@ ADD . /app RUN [ "qemu-arm-static", "/bin/sh", "-c", \ "cp /app/data/configuration.yaml /app && \ cp /app/docker/run.sh /app && chmod +x /app/run.sh && \ - apk add --update --no-cache make gcc g++ python linux-headers udev nodejs git && \ + apk add --update --no-cache make gcc g++ python linux-headers udev nodejs=8.11.4-r0 git && \ npm install --unsafe-perm && \ apk del make gcc g++ python linux-headers udev git"] diff --git a/docker/Dockerfile.arm64v8 b/docker/Dockerfile.arm64v8 index b327f8783..fe2f794b8 100644 --- a/docker/Dockerfile.arm64v8 +++ b/docker/Dockerfile.arm64v8 @@ -1,4 +1,4 @@ -FROM arm64v8/alpine:3.7 +FROM arm64v8/alpine:3.8 # Setup cross-build ENV QEMU_EXECVE 1 @@ -14,7 +14,7 @@ ADD . /app RUN [ "qemu-aarch64-static", "/bin/sh", "-c", \ "cp /app/data/configuration.yaml /app && \ cp /app/docker/run.sh /app && chmod +x /app/run.sh && \ - apk add --update --no-cache make gcc g++ python linux-headers udev nodejs git && \ + apk add --update --no-cache make gcc g++ python linux-headers udev nodejs=8.11.4-r0 git && \ npm install --unsafe-perm && \ apk del make gcc g++ python linux-headers udev git"] diff --git a/index.js b/index.js index 9f509b9e2..0f141b2e7 100644 --- a/index.js +++ b/index.js @@ -1,5 +1,12 @@ -const Controller = require('./lib/controller'); +const semver = require('semver'); +const engines = require('./package.json').engines; +const version = engines.node; +if (!semver.satisfies(process.version, version)) { + console.log(`\t\tZigbee2mqtt requires node version ${version}, you are running ${process.version}!\n`); // eslint-disable-line +} + +const Controller = require('./lib/controller'); const controller = new Controller(); controller.start(); diff --git a/package.json b/package.json index e255d19cd..d5f2ac65f 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,9 @@ "type": "git", "url": "git+https://github.com/Koenkk/zigbee2mqtt.git" }, + "engines": { + "node": ">=8.11 10" + }, "keywords": [ "xiaomi", "tradfri",