RITlug / teleirc

Go implementation of a Telegram <=> IRC bridge for use with any IRC channel and Telegram group
https://docs.teleirc.com/
GNU General Public License v3.0
140 stars 45 forks source link

npm install fails when using docker-compose with Node Alpine Linux image #60

Closed dhaneshsabane closed 6 years ago

dhaneshsabane commented 6 years ago

The Error:

dhanesh@web:~/teleirc$ docker-compose up -d teleirc
Building teleirc
Step 1/9 : FROM node:8-alpine
 ---> ca148a52ea10
Step 2/9 : RUN apk add --no-cache --update bash         && addgroup -g 99 teleirc         && adduser -s /bin/bash -h /opt/teleirc -D -H teleirc -u 99 -G teleirc
 ---> Running in c5579faf03a4
fetch http://dl-cdn.alpinelinux.org/alpine/v3.6/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.6/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.6/community/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.6/community/x86_64/APKINDEX.tar.gz
(1/5) Installing ncurses-terminfo-base (6.0_p20171125-r0)
(2/5) Installing ncurses-terminfo (6.0_p20171125-r0)
(3/5) Installing ncurses-libs (6.0_p20171125-r0)
(4/5) Installing readline (6.3.008-r5)
(5/5) Installing bash (4.3.48-r1)
Executing bash-4.3.48-r1.post-install
Executing busybox-1.26.2-r11.trigger
OK: 14 MiB in 20 packages
 ---> 26be5ee24e07
Removing intermediate container c5579faf03a4
Step 3/9 : WORKDIR /opt/teleirc
 ---> ea3dec38240d
Removing intermediate container 1873e28aaf11
Step 4/9 : CMD node teleirc.js
 ---> Running in d7fe13c00f80
 ---> 27a2389bdeb6
Removing intermediate container d7fe13c00f80
Step 5/9 : COPY . /opt/teleirc
 ---> 57a086166ac7
Removing intermediate container 9c149b22b461
Step 6/9 : COPY config.js.example /opt/teleirc/config.js
 ---> 328fb76c62c7
Removing intermediate container d1c38505e8f4
Step 7/9 : RUN chown -R teleirc:teleirc /opt/teleirc
 ---> Running in 17e497782e8f
 ---> 47366bf75fde
Removing intermediate container 17e497782e8f
Step 8/9 : USER teleirc
 ---> Running in 0d351f0f03f4
 ---> 4d4850d08f15
Removing intermediate container 0d351f0f03f4
Step 9/9 : RUN npm install
 ---> Running in d18f99f02eb4
npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN notice [SECURITY] minimatch has the following vulnerability: 1 high. Go here for more details: https://nodesecurity.io/advisories?search=minimatch&version=2.0.10 - Run `npm i npm@latest -g` to upgrade your npm version, and then `npm audit` to get more info.

> node@8.11.3 preinstall /opt/teleirc/node_modules/node
> node installArchSpecificPackage

+ node-linux-x64@8.11.3
added 1 package in 4.086s

> iconv@2.2.3 install /opt/teleirc/node_modules/irc/node_modules/iconv
> node-gyp rebuild

gyp ERR! configure error 
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack     at PythonFinder.failNoPython (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:483:19)
gyp ERR! stack     at PythonFinder.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:397:16)
gyp ERR! stack     at F (/usr/local/lib/node_modules/npm/node_modules/which/which.js:68:16)
gyp ERR! stack     at E (/usr/local/lib/node_modules/npm/node_modules/which/which.js:80:29)
gyp ERR! stack     at /usr/local/lib/node_modules/npm/node_modules/which/which.js:89:16
gyp ERR! stack     at /usr/local/lib/node_modules/npm/node_modules/which/node_modules/isexe/index.js:42:5
gyp ERR! stack     at /usr/local/lib/node_modules/npm/node_modules/which/node_modules/isexe/mode.js:8:5
gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:152:21)
gyp ERR! System Linux 4.4.0-87-generic
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /opt/teleirc/node_modules/irc/node_modules/iconv
gyp ERR! node -v v8.11.3
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 

> node-icu-charset-detector@0.2.0 install /opt/teleirc/node_modules/node-icu-charset-detector
> node-gyp rebuild

gyp ERR! configure error 
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack     at PythonFinder.failNoPython (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:483:19)
gyp ERR! stack     at PythonFinder.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:397:16)
gyp ERR! stack     at F (/usr/local/lib/node_modules/npm/node_modules/which/which.js:68:16)
gyp ERR! stack     at E (/usr/local/lib/node_modules/npm/node_modules/which/which.js:80:29)
gyp ERR! stack     at /usr/local/lib/node_modules/npm/node_modules/which/which.js:89:16
gyp ERR! stack     at /usr/local/lib/node_modules/npm/node_modules/which/node_modules/isexe/index.js:42:5
gyp ERR! stack     at /usr/local/lib/node_modules/npm/node_modules/which/node_modules/isexe/mode.js:8:5
gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:152:21)
gyp ERR! System Linux 4.4.0-87-generic
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /opt/teleirc/node_modules/node-icu-charset-detector
gyp ERR! node -v v8.11.3
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 

> iconv@2.3.0 install /opt/teleirc/node_modules/iconv
> node-gyp rebuild

gyp ERR! configure error 
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack     at PythonFinder.failNoPython (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:483:19)
gyp ERR! stack     at PythonFinder.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:397:16)
gyp ERR! stack     at F (/usr/local/lib/node_modules/npm/node_modules/which/which.js:68:16)
gyp ERR! stack     at E (/usr/local/lib/node_modules/npm/node_modules/which/which.js:80:29)
gyp ERR! stack     at /usr/local/lib/node_modules/npm/node_modules/which/which.js:89:16
gyp ERR! stack     at /usr/local/lib/node_modules/npm/node_modules/which/node_modules/isexe/index.js:42:5
gyp ERR! stack     at /usr/local/lib/node_modules/npm/node_modules/which/node_modules/isexe/mode.js:8:5
gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:152:21)
gyp ERR! System Linux 4.4.0-87-generic
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /opt/teleirc/node_modules/iconv
gyp ERR! node -v v8.11.3
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: iconv@2.2.3 (node_modules/irc/node_modules/iconv):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: iconv@2.2.3 install: `node-gyp rebuild`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: node-icu-charset-detector@0.2.0 (node_modules/node-icu-charset-detector):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: node-icu-charset-detector@0.2.0 install: `node-gyp rebuild`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! iconv@2.3.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the iconv@2.3.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /opt/teleirc/.npm/_logs/2018-07-18T13_57_42_290Z-debug.log
ERROR: Service 'teleirc' failed to build: The command '/bin/sh -c npm install' returned a non-zero code: 1

Expected behaviour

The container builds successfully and teleirc is spawned.

Host machine details

OS: Ubuntu/Xenial Docker: Installed the docker-io package from the Ubuntu Xenial repo

jwflory commented 6 years ago

@Dhanesh95 I assume you are using the Alpine Node image for this. Somehow it's trying to find a Python binary, but I don't know why this is. I wonder if it is because of the Sphinx docs, and somehow it thinks it needs Python (but really doesn't, because the Docker image isn't serving the docs).

@robbyoconnor Any ideas here?

Otherwise, I'll add this to my eventual list of debugging items, but it's a lower priority for me right now. @Dhanesh95 is this actively blocking you from using Teleirc?

dhaneshsabane commented 6 years ago

On Sunday 29 July 2018 09:04 PM, Justin W. Flory wrote: @Dhanesh95

https://github.com/Dhanesh95 is this actively blocking you from using Teleirc?

No. This isn't blocking me from using teleirc. I followed the traditional method of installing the packages using npm and running the bridge using pm2. Take your time to fix this issue.

robbyoconnor commented 6 years ago

Oh christ -- hold on -- I'll fix this now.

robbyoconnor commented 6 years ago

Fixed in #63