Fix node version to >=8.11 10 and implement check on startup. https://github.com/Koenkk/zigbee2mqtt/issues/552

This commit is contained in:
Koenkk
2018-11-07 20:05:14 +01:00
parent 2cb27b14f9
commit fc664bdc68
6 changed files with 18 additions and 8 deletions
+1 -1
View File
@@ -6,7 +6,7 @@ services:
- docker
node_js:
- "8"
- "10"
install:
- npm install
+2 -2
View File
@@ -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
+2 -2
View File
@@ -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"]
+2 -2
View File
@@ -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"]
+8 -1
View File
@@ -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();
+3
View File
@@ -7,6 +7,9 @@
"type": "git",
"url": "git+https://github.com/Koenkk/zigbee2mqtt.git"
},
"engines": {
"node": ">=8.11 10"
},
"keywords": [
"xiaomi",
"tradfri",