chip-gpio icon indicating copy to clipboard operation
chip-gpio copied to clipboard

4.4 support

Open bakroistvan opened this issue 8 years ago • 1 comments

# npm install chip-gpio --save
-
> [email protected] install /home/chip/secu/node_modules/chip-gpio/node_modules/epoll
> node-gyp rebuild

make: Entering directory '/home/chip/secu/node_modules/chip-gpio/node_modules/epoll/build'
  CXX(target) Release/obj.target/epoll/src/epoll.o
In file included from ../src/epoll.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;
                                               ^
epoll.target.mk:84: recipe for target 'Release/obj.target/epoll/src/epoll.o' failed
make: *** [Release/obj.target/epoll/src/epoll.o] Error 1
make: Leaving directory '/home/chip/secu/node_modules/chip-gpio/node_modules/epoll/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/share/node-gyp/lib/build.js:267:23)
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.4.13-ntc-mlc
gyp ERR! command "nodejs" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /home/chip/secu/node_modules/chip-gpio/node_modules/epoll
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
 
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the epoll package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls epoll
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 4.4.13-ntc-mlc
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "chip-gpio" "--save"
npm ERR! cwd /home/chip/secu
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.21
npm ERR! code ELIFECYCLE
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/chip/secu/npm-debug.log
npm ERR! not ok code 0

I found the workaround here: https://github.com/fivdi/onoff/wiki/Node.js-v0.10.29-and-native-addons-on-the-Raspberry-Pi

Running the sample code, I get the following error:

/home/chip/secu/node_modules/chip-gpio/index.js:7
if (os.release().startsWith("4.4")) {
                 ^
TypeError: Object 4.4.13-ntc-mlc has no method 'startsWith'
    at Object.<anonymous> (/home/chip/secu/node_modules/chip-gpio/index.js:7:18)
    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)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/home/chip/secu/test.js:1:74)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)

bakroistvan avatar Nov 17 '16 00:11 bakroistvan

What is your current version of Node? The first NPM error log shows 0.10, but the workaround that you linked should have changed that.

You can get the version by running "node -v".

jeremyscalpello avatar Nov 18 '16 12:11 jeremyscalpello