Open stevenlouis opened 7 years ago
Thanks for sharing this. A couple of quick questions .. do you have alsa (sound) libraries installed ?
sudo apt-get install alsa-base alsa-utils
sudo apt-get install libasound2-dev
Your error appears similar to the error here - https://github.com/TooTallNate/node-speaker/issues/1
Let me know if this installing the sound libs fix it for you.
-V.
The first command was run, but I did not see the second. Just ran it followed by npm install again and it seems to have gotten rid of the npm install errors. However, the wavetest.js run is still returning errors. Running without sudo returns permission errors and running with sudo returns the following:
/tjwave-master $ sudo node wavetest.js
module.js:356
Module._extensions[extension](this, filename);
^
Error: /home/pi/tjwave-master/node_modules/rpi-ws281x-native/lib/binding/rpi_ws281x.node: undefined symbol: node_module_register
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at getNativeBindings (/home/pi/tjwave-master/node_modules/rpi-ws281x-native/lib/ws281x-native.js:60:12)
at Object.<anonymous> (/home/pi/tjwave-master/node_modules/rpi-ws281x-native/lib/ws281x-native.js:63:16)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
Errors when running wavetest.js without sudo:
/tjwave-master $ node wavetest.js
[rpi-ws281x-native] This module requires being run with root-privileges. A non-functional stub of the interface will be returned.
2016-12-20 12:36:55 initCheckPermitted:
+---------------------------------------------------------+
|Sorry, you don't have permission to run this program. |
|Try running as root, e.g. precede the command with sudo. |
+---------------------------------------------------------+
/home/pi/tjwave-master/node_modules/pigpio/pigpio.js:11
pigpio.gpioInitialise();
^
Error: pigpio error -1 in gpioInitialise
at initializePigpio (/home/pi/tjwave-master/node_modules/pigpio/pigpio.js:11:12)
at new Gpio (/home/pi/tjwave-master/node_modules/pigpio/pigpio.js:25:3)
at Object.<anonymous> (/home/pi/tjwave-master/wavetest.js:19:13)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.runMain (module.js:605:10)
at run (bootstrap_node.js:420:7)
I just updated readme with the second libasound2-dev
line, thats why you didnt see that earlier (my fault).
Regarding the module error above, can you try deleting your node_modules folder and installing again. I suspect the earlier errors may have corrupted your node_modules install folder.
rm -rf node_modules
npm install
Yeah, you do need root (sudo) to control your servo motor and leds.
-V.
removed the node_modules directory and ran the install again, but we're still getting errors.
tjwave-master $ node wavetest.js
[rpi-ws281x-native] This module requires being run with root-privileges. A non-functional stub of the interface will be returned.
2016-12-20 12:40:49 initCheckPermitted:
+---------------------------------------------------------+
|Sorry, you don't have permission to run this program. |
|Try running as root, e.g. precede the command with sudo. |
+---------------------------------------------------------+
/home/pi/tjwave-master/node_modules/pigpio/pigpio.js:11
pigpio.gpioInitialise();
^
Error: pigpio error -1 in gpioInitialise
at initializePigpio (/home/pi/tjwave-master/node_modules/pigpio/pigpio.js:11:12)
at new Gpio (/home/pi/tjwave-master/node_modules/pigpio/pigpio.js:25:3)
at Object.<anonymous> (/home/pi/tjwave-master/wavetest.js:19:13)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.runMain (module.js:605:10)
at run (bootstrap_node.js:420:7)
/tjwave-master $ sudo node wavetest.js
module.js:356
Module._extensions[extension](this, filename);
^
Error: /home/pi/tjwave-master/node_modules/rpi-ws281x-native/lib/binding/rpi_ws281x.node: undefined symbol: node_module_register
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at getNativeBindings (/home/pi/tjwave-master/node_modules/rpi-ws281x-native/lib/ws281x-native.js:60:12)
at Object.<anonymous> (/home/pi/tjwave-master/node_modules/rpi-ws281x-native/lib/ws281x-native.js:63:16)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
There is a possibility that you have an old version of node being referenced. Can you provide the results to the following commands
which node
and
node -v
to make sure
It appears a similar issue has been noted here - Unitech/pm2#1477
which node: /home/pi/.nvm/versions/node/v7.2.1/bin/node
node -v: v7.2.1
I see you use nvm to manage node versions. I also see it appears to be correctly installed (the earlier error suggests npm was correctly referencing your v7.2.1 installation).
Some thoughts though.
Going by the comment here
For us, it was because we installed node 0.10.x a long time ago globally /usr/local/bin and then setup NVM after. While our app was using the NVM version 0.12.x npm install was actually using the globally installed version in /usr/local/bin.
The solution, was to delete all references to node in /usr/loca/bin and only use NVM. Then do npm install again.
Perhaps you can delete the node directory in /usr/local/bin if you haven't done so already, delete node_modules folder, and npm install .
-V.
I'm not seeing anything related to node in that directory. Could it be somewhere else?
pi@raspberrypi:/usr/local/bin $ ls
ffmpeg ffprobe ffserver x264
Unlikely. Finally, any chance you can reinstall node without nvm ?
-V
Upon attempting npm install, getting several errors. (Wavetest.js attempted after and will not run.)
errors as follows: