homebridge-docker icon indicating copy to clipboard operation
homebridge-docker copied to clipboard

NPM not found?

Open martzcodes opened this issue 8 years ago • 9 comments

Hi, I am trying to get this working but am having trouble. I cloned the repo, added my config.json file and then ran ./homebridge.sh build and got:

~/homebridge-docker$ ./homebridge.sh build
sed: -e expression #1, char 1: unknown command: `.'
Sending build context to Docker daemon 116.2 kB
Step 1 : FROM debian:jessie
 ---> 23cb15b0fcec
Step 2 : MAINTAINER Patrick Busch <[email protected]>
 ---> Using cache
 ---> c855dba22676
Step 3 : RUN apt-get update
 ---> Using cache
 ---> 51d38427a38c
Step 4 : ENV LANG en_US.UTF-8
 ---> Using cache
 ---> a2da2c7a72b1
Step 5 : ENV LC_ALL en_US.UTF-8
 ---> Using cache
 ---> 406786b1398e
Step 6 : ENV DEBIAN_FRONTEND noninteractive
 ---> Using cache
 ---> f9440dcd0709
Step 7 : ENV TERM xterm
 ---> Using cache
 ---> 7bd790c54b9c
Step 8 : RUN apt-get install -y curl wget git apt-transport-https python build-essential make g++ libavahi-compat-libdnssd-dev libkrb5-dev vim net-tools
 ---> Using cache
 ---> 068a27640612
Step 9 : RUN alias ll='ls -alG'
 ---> Using cache
 ---> 5f46cecdb45e
Step 10 : RUN npm install -g homebridge
 ---> Running in 513493eaa828
/bin/sh: 1: npm: not found
The command '/bin/sh -c npm install -g homebridge' returned a non-zero code: 127

Any ideas?

martzcodes avatar Jan 03 '16 20:01 martzcodes

probably your docker containers don't have network and therefore the apt-get failed. I had this problem on a raspberrypi.

snizzleorg avatar Jan 03 '16 21:01 snizzleorg

no reason it shouldn't have network... it's in docker build, after all. I have a few other containers up and running doing things with the network

martzcodes avatar Jan 03 '16 21:01 martzcodes

try to delete the cache and see if the apt-get steps runs alright...

snizzleorg avatar Jan 03 '16 21:01 snizzleorg

@snizzleorg there is no cache, it's using docker image (which has no cache initially)

martzcodes avatar Jan 03 '16 22:01 martzcodes

it looks like the Dockerfile.specific is never getting into the Dockerfile...

something to do with this perhaps:

sed: -e expression #1, char 1: unknown command: `.'

martzcodes avatar Jan 03 '16 23:01 martzcodes

@snizzleorg In the homebridge.sh file there's an offending '.bak' in the SED expression... I don't think it should be there, and seems to be causing the problem.

martzcodes avatar Jan 03 '16 23:01 martzcodes

yeah but the docker image is built by the script and the interims images are stored on your computer. so the the one you built doesn't have nam installed (probably because during the build there was no network)

snizzleorg avatar Jan 04 '16 08:01 snizzleorg

@oehokie Just saw your last comments. It did work for me... but maybe it's been changed since I used it to build the image.

snizzleorg avatar Jan 04 '16 08:01 snizzleorg

The problem is that the base image doesn't seem to actually ship with node? This is using a vanilla Jessy image as the upstream. NPM is straight up not installed at any time during build. What OS are you running this on? I'm seeing this on Ubuntu 16.04

ericgoedtel avatar Apr 29 '17 21:04 ericgoedtel