evancohen / sonus

:speech_balloon: /so.nus/ STT (speech to text) for Node with offline hotword detection
MIT License
618 stars 79 forks source link

Raspbian - Install fail #80

Closed ByFede closed 6 years ago

ByFede commented 6 years ago

I tried with Node v6.0.0, cloning the git but I can't make it install without fail

Node v9.4.0 NPM v5.6.0 Raspbian November 2017

Terminal when install:

@raspberrypi:~/test1 $ npm install --save sonus

> snowboy@1.2.0 preinstall /home/pi/test1/node_modules/snowboy
> npm install node-pre-gyp

npm notice created a lockfile as package-lock.json. You should commit this file.
+ node-pre-gyp@0.6.39
added 113 packages in 27.462s

> grpc@1.8.0 install /home/pi/test1/node_modules/grpc
> node-pre-gyp install --fallback-to-build --library=static_library

[grpc] Success: "/home/pi/test1/node_modules/grpc/src/node/extension_binary/node-v59-linux-arm-glibc/grpc_node.node" is installed via remote

> snowboy@1.2.0 install /home/pi/test1/node_modules/snowboy
> node-pre-gyp install --fallback-to-build

node-pre-gyp ERR! Tried to download(403): https://snowboy-release-node.s3-us-west-2.amazonaws.com/snowboy/v1.2.0/Release/snowboy-v1.2.0-node-v59-linux-arm.tar.gz 
node-pre-gyp ERR! Pre-built binaries not found for snowboy@1.2.0 and node@9.4.0 (node-v59 ABI, glibc) (falling back to source compile with node-gyp) 
make: Entering directory '/home/pi/test1/node_modules/snowboy/build'
  CXX(target) Release/obj.target/snowboy/swig/Node/snowboy.o
  SOLINK_MODULE(target) Release/obj.target/snowboy.node
  COPY Release/snowboy.node
  COPY /home/pi/test1/node_modules/snowboy/lib/node/binding/Release/node-v59-linux-arm/snowboy.node
  TOUCH Release/obj.target/action_after_build.stamp
make: Leaving directory '/home/pi/test1/node_modules/snowboy/build'

> protobufjs@6.8.4 postinstall /home/pi/test1/node_modules/protobufjs
> node scripts/postinstall

npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN test1@1.0.0 No description
npm WARN test1@1.0.0 No repository field.

+ sonus@0.1.9
added 309 packages in 317.147s

Terminal when I try to run

@raspberrypi:~ $ node sonus
module.js:557
    throw err;
    ^

Error: Cannot find module 'snowboy'
    at Function.Module._resolveFilename (module.js:555:15)
    at Function.Module._load (module.js:482:25)
    at Module.require (module.js:604:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/home/pi/sonus/index.js:5:30)
    at Module._compile (module.js:660:30)
    at Object.Module._extensions..js (module.js:671:10)
    at Module.load (module.js:573:32)
    at tryModuleLoad (module.js:513:12)
    at Function.Module._load (module.js:505:3)

When try examples:

@raspberrypi:~/test1/node_modules/sonus/examples $ node example.js 
ERROR (Input():snowboy-io.cc:315) Fail to open input file "node_modules/snowboy/resources/common.res"
terminate called after throwing an instance of 'std::runtime_error'
  what():  ERROR (Input():snowboy-io.cc:315) Fail to open input file "node_modules/snowboy/resources/common.res"

[stack trace: ]
/home/pi/test1/node_modules/snowboy/lib/node/binding/Release/node-v59-linux-arm/snowboy.node(_ZN7snowboy13GetStackTraceEv+0x34) [0x7487c3c0]
/home/pi/test1/node_modules/snowboy/lib/node/binding/Release/node-v59-linux-arm/snowboy.node(_ZN7snowboy13SnowboyLogMsgD1Ev+0x4b8) [0x7487ca00]
/home/pi/test1/node_modules/snowboy/lib/node/binding/Release/node-v59-linux-arm/snowboy.node(_ZN7snowboy5InputC1ERKSs+0x264) [0x74881ae8]
/home/pi/test1/node_modules/snowboy/lib/node/binding/Release/node-v59-linux-arm/snowboy.node(_ZN7snowboy22UnpackPipelineResourceERKSsPSs+0x28) [0x748789f8]
/home/pi/test1/node_modules/snowboy/lib/node/binding/Release/node-v59-linux-arm/snowboy.node(_ZN7snowboy11PipelineItf11SetResourceERKSs+0x190) [0x7486ace8]
/home/pi/test1/node_modules/snowboy/lib/node/binding/Release/node-v59-linux-arm/snowboy.node(_ZN7snowboy13SnowboyDetectC1ERKSsS2_+0x7c) [0x7485bcb8]
/home/pi/test1/node_modules/snowboy/lib/node/binding/Release/node-v59-linux-arm/snowboy.node(_ZN13SnowboyDetectC1ERKSsS1_+0x54) [0x7485af9c]
/home/pi/test1/node_modules/snowboy/lib/node/binding/Release/node-v59-linux-arm/snowboy.node(_ZN13SnowboyDetect3NewERKN3Nan20FunctionCallbackInfoIN2v85ValueEEE+0x430) [0x7485b47c]
/home/pi/test1/node_modules/snowboy/lib/node/binding/Release/node-v59-linux-arm/snowboy.node(+0x1ea40) [0x74858a40]

Aborted

When run test.js:

@raspberrypi:~/test1/node_modules/sonus $ node test.js 
Recording with sample rate 16000...
End Recording: 22.860ms
ByFede commented 6 years ago

Solve it!

uninstall and purge all manually then install v6.0.0 using vnm