node-v4l2camera icon indicating copy to clipboard operation
node-v4l2camera copied to clipboard

npm install on Raspberry Pi not working

Open amnotafraid opened this issue 7 years ago • 2 comments

When I try to install v4l2camera, I get an error. Is there any way to fix this?

I execute the following command:

npm install v4l2camera

I get this output:

> [email protected] install /srv/raspberry-pi-nodejs-barcode-reader-/node_modules/v4l2camera
> node-gyp rebuild

sh: 1: node-gyp: Permission denied
npm WARN [email protected] No repository field.

npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the [email protected] 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!     /root/.npm/_logs/2017-08-07T14_06_05_145Z-debug.log

Details

npm debug log

Some of the debug logfile says this:

0 info it worked if it ends with ok
1 verbose cli [ '/root/.nvm/versions/node/v6.10.0/bin/node',
1 verbose cli   '/root/.nvm/versions/node/v6.10.0/bin/npm',
1 verbose cli   'install',
1 verbose cli   'v4l2camera' ]
2 info using [email protected]
3 info using [email protected]
...
78 info lifecycle [email protected]~install: [email protected]
79 verbose lifecycle [email protected]~install: unsafe-perm in lifecycle false
80 verbose lifecycle [email protected]~install: PATH: /root/.nvm/versions/node/v6.10.0/lib/node_modules/npm/bin/node-gyp-bin:/srv/raspberry-pi-nodejs-barcode-reader-/node_modules/v4l2camera/node_modules/.bin:/srv/raspberry-pi-nodejs-barcode-reader-/node_modules/.bin:/root/.nvm/versions/node/v6.10.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
81 verbose lifecycle [email protected]~install: CWD: /srv/raspberry-pi-nodejs-barcode-reader-/node_modules/v4l2camera
82 silly lifecycle [email protected]~install: Args: [ '-c', 'node-gyp rebuild' ]
83 info lifecycle [email protected]~install: Failed to exec install script
84 verbose unlock done using /root/.npm/_locks/staging-414dd603579dbefb.lock for /srv/raspberry-pi-nodejs-barcode-reader-/node_modules/.staging
85 warn [email protected] No repository field.
86 verbose stack Error: [email protected] install: `node-gyp rebuild`
86 verbose stack spawn ENOENT
86 verbose stack     at ChildProcess.<anonymous> (/root/.nvm/versions/node/v6.10.0/lib/node_modules/npm/lib/utils/spawn.js:33:16)
86 verbose stack     at emitTwo (events.js:106:13)
86 verbose stack     at ChildProcess.emit (events.js:191:7)
86 verbose stack     at maybeClose (internal/child_process.js:877:16)
86 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
87 verbose pkgid [email protected]
88 verbose cwd /srv/raspberry-pi-nodejs-barcode-reader-
89 verbose Linux 4.9.35+
90 verbose argv "/root/.nvm/versions/node/v6.10.0/bin/node" "/root/.nvm/versions/node/v6.10.0/bin/npm" "install" "v4l2camera"
91 verbose node v6.10.0
92 verbose npm  v5.3.0
93 error file sh
94 error code ELIFECYCLE
95 error errno ENOENT
96 error syscall spawn
97 error [email protected] install: `node-gyp rebuild`
97 error spawn ENOENT
98 error Failed at the [email protected] install script.
98 error This is probably not a problem with npm. There is likely additional logging output above.
99 verbose exit [ 1, true ]

Version information

cat /etc/os-release

PRETTY_NAME="Raspbian GNU/Linux 8 (jessie)"
NAME="Raspbian GNU/Linux"
VERSION_ID="8"
VERSION="8 (jessie)"
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

python

Python 2.7.9

make

GNU Make 4.0

gcc

gcc version 4.9.2 (Raspbian 4.9.2-10)

Node

v6.10.0

npm

5.3.0

amnotafraid avatar Aug 07 '17 14:08 amnotafraid

Try sudo npm install v4l2camera —I've noticed this is required for installing certain packages on Raspberry Pi.

knaut avatar Aug 07 '17 20:08 knaut

In my case I did npm install --unsafe-perm

agonza1 avatar Mar 14 '18 14:03 agonza1