Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install fails on Raspbian #41

Open
RenHoekNL opened this issue Aug 16, 2017 · 5 comments
Open

Install fails on Raspbian #41

RenHoekNL opened this issue Aug 16, 2017 · 5 comments

Comments

@RenHoekNL
Copy link

I have a current and updated RasPi with Raspbian GNU/Linux 8.0 (jessie).

After I run

apt -y install apache2 git npm
git clone https://github.com/131/h264-live-player.git player
cd player
npm install

I get these errors:

npm WARN deprecated connect@2.30.2: connect 2.x series is deprecated

utf-8-validate@1.2.2 install /var/www/html/player/node_modules/ws/node_modules/utf-8-validate
node-gyp rebuild

/bin/sh: 1: node: not found
gyp: Call to 'node -e "require('nan')"' returned exit status 127. while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: gyp failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/share/node-gyp/lib/configure.js:344:16)
gyp ERR! stack at ChildProcess.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:809:12)
gyp ERR! System Linux 4.9.35-v7+
gyp ERR! command "nodejs" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /var/www/html/player/node_modules/ws/node_modules/utf-8-validate
gyp ERR! node -v v0.10.29
gyp ERR! node-gyp -v v0.12.2
gyp ERR! not ok
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian

bufferutil@1.2.1 install /var/www/html/player/node_modules/ws/node_modules/bufferutil
node-gyp rebuild

/bin/sh: 1: node: not found
gyp: Call to 'node -e "require('nan')"' returned exit status 127. while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: gyp failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/share/node-gyp/lib/configure.js:344:16)
gyp ERR! stack at ChildProcess.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:809:12)
gyp ERR! System Linux 4.9.35-v7+
gyp ERR! command "nodejs" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /var/www/html/player/node_modules/ws/node_modules/bufferutil
gyp ERR! node -v v0.10.29
gyp ERR! node-gyp -v v0.12.2
gyp ERR! not ok
npm WARN optional dep failed, continuing utf-8-validate@1.2.2
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian

npm WARN optional dep failed, continuing bufferutil@1.2.1
npm WARN cannot run in wd h264-live-stream-demo-server@1.0.0 cd vendor && npm install (wd=/var/www/html/player)
stream-split@1.1.0 node_modules/stream-split

stream-throttle@0.1.3 node_modules/stream-throttle
├── commander@2.11.0
└── limiter@1.1.2

express@3.21.2 node_modules/express
├── escape-html@1.0.2
├── merge-descriptors@1.0.0
├── cookie@0.1.3
├── utils-merge@1.0.0
├── cookie-signature@1.0.6
├── methods@1.1.2
├── fresh@0.3.0
├── range-parser@1.0.3
├── basic-auth@1.0.4
├── vary@1.0.1
├── parseurl@1.3.1
├── content-type@1.0.2
├── etag@1.7.0
├── content-disposition@0.5.0
├── commander@2.6.0
├── depd@1.0.1
├── debug@2.2.0 (ms@0.7.1)
├── proxy-addr@1.0.10 (forwarded@0.1.0, ipaddr.js@1.0.5)
├── send@0.13.0 (destroy@1.0.3, statuses@1.2.1, ms@0.7.1, mime@1.3.4, http-errors@1.3.1, on-finished@2.3.0)
├── mkdirp@0.5.1 (minimist@0.0.8)
└── connect@2.30.2 (bytes@2.1.0, pause@0.1.0, on-headers@1.0.1, vhost@3.0.2, basic-auth-connect@1.0.0, cookie-parser@1.3.5, connect-timeout@1.6.2, serve-favicon@2.3.2, http-errors@1.3.1, qs@4.0.0, response-time@2.3.2, morgan@1.6.1, finalhandler@0.4.0, express-session@1.11.3, csurf@1.8.3, method-override@2.3.9, serve-static@1.10.3, multiparty@3.3.2, type-is@1.6.15, body-parser@1.13.3, errorhandler@1.4.3, compression@1.5.2, serve-index@1.7.3)

mout@1.0.0 node_modules/mout

ws@0.8.1 node_modules/ws
├── options@0.0.6
└── ultron@1.0.2

I am not familiar with NodeJS, so can anybody tell me what I am doing wrong or if I forget some dependencies?

@RenHoekNL
Copy link
Author

I might have progressed a little, after doing

apt-get -y install nodejs-legacy
npm -g install npm node-gyp

But now I'm stuck on this error:

make: Entering directory '/root/player/node_modules/ws/node_modules/utf-8-validate/build'
CXX(target) Release/obj.target/validation/src/validation.o
In file included from ../src/validation.cc:15:0:
../node_modules/nan/nan.h:324:47: error: 'REPLACE_INVALID_UTF8' is not a member of 'v8::String'
static const unsigned kReplaceInvalidUtf8 = v8::String::REPLACE_INVALID_UTF8;
^
validation.target.mk:84: recipe for target 'Release/obj.target/validation/src/validation.o' failed
make: *** [Release/obj.target/validation/src/validation.o] Error 1
make: Leaving directory '/root/player/node_modules/ws/node_modules/utf-8-validate/build'

I see 'optional module' but trying 'node server-rpi.js' gives more errors:

/root/player/server-rpi.js:9
const http = require('http');
^^^^^
SyntaxError: Use of const in strict mode.
at Module._compile (module.js:439:25)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:906:3

Is h264-live-player maintained or should I just forget about this and find another way to stream my video to my webbrowser?

@131
Copy link
Owner

131 commented Aug 17, 2017

Which version of nodejs are you using ? (non support for const http = require('http'); might be relevant (you'll probably need to use node >= 4)

@RenHoekNL
Copy link
Author

root@raspberrypi:~# nodejs --version
v0.10.29

It's the latest available on Raspbian

@131
Copy link
Owner

131 commented Aug 17, 2017

nodejs 4 is a standalone binary (with no dependencies) and can be easily updated from *.gz archives for ARM arch from https://nodejs.org/dist/latest-v4.x/

I'll state a minimal version in the package.json

@aplocher
Copy link

aplocher commented Sep 3, 2017

I don't know anything about the nodejs-legacy package, but I've had to deal with your original issue several times ("node not found").

In Raspbian (maybe Ubuntu/Debian too) the nodejs package in the apt repo doesn't link /usr/bin/nodejs to /usr/bin/node, which a standard installation should do. Simply running sudo ln -s /usr/bin/nodejs /usr/bin/node will fix the problem (assuming you've already installed the nodejs package).

Basically to get "npm install" to work, I had to run:

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install npm nodejs
sudo ln -s /usr/bin/nodejs /usr/bin/node

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants