dolanmiu / MMM-awesome-alexa

Turn your MagicMirror into an 'Amazon Echo'. Activated when you say 'Alexa'.
https://awesome-alexa.js.org
MIT License
158 stars 51 forks source link

Error Installing #184

Open raspberrypi9 opened 4 years ago

raspberrypi9 commented 4 years ago

Hi,

I tried to install and received the following errors:

If you know how to work around them, I'd really appreciate your help.

Thanks!

pi@raspberrypi:~/MagicMirror/modules/MMM-awesome-alexa $ npm install --only=prod

snowboy@1.3.1 install /home/pi/MagicMirror/modules/MMM-awesome-alexa/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.3.1/Release/snowboy-v1.3.1-node-v64-linux-arm.tar.gz node-pre-gyp ERR! Pre-built binaries not found for snowboy@1.3.1 and node@10.18.1 (node-v64 ABI, glibc) (falling back to source compile with node-gyp) node-pre-gyp ERR! Tried to download(undefined): https://snowboy-release-node.s3-us-west-2.amazonaws.com/snowboy/v1.3.1/Release/snowboy-v1.3.1-node-v64-linux-arm.tar.gz node-pre-gyp ERR! Pre-built binaries not found for snowboy@1.3.1 and node@10.18.1 (node-v64 ABI, glibc) (falling back to source compile with node-gyp) internal/modules/cjs/loader.js:638 throw err; ^

Error: Cannot find module 'nan' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15) at Function.Module._load (internal/modules/cjs/loader.js:562:25) at Module.require (internal/modules/cjs/loader.js:692:17) at require (internal/modules/cjs/helpers.js:25:18) at [eval]:1:1 at Script.runInThisContext (vm.js:122:20) at Object.runInThisContext (vm.js:329:38) at Object. ([eval]-wrapper:6:22) at Module._compile (internal/modules/cjs/loader.js:778:30) at evalScript (internal/bootstrap/node.js:590:27) internal/modules/cjs/loader.js:638 throw err; ^

Error: Cannot find module 'nan' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15) at Function.Module._load (internal/modules/cjs/loader.js:562:25) at Module.require (internal/modules/cjs/loader.js:692:17) at require (internal/modules/cjs/helpers.js:25:18) at [eval]:1:1 at Script.runInThisContext (vm.js:122:20) at Object.runInThisContext (vm.js:329:38) at Object. ([eval]-wrapper:6:22) at Module._compile (internal/modules/cjs/loader.js:778:30) at evalScript (internal/bootstrap/node.js:590:27) gyp: Call to 'node -e "require('nan')"' returned exit status 1 while in binding.gyp. while trying to load binding.gyp gyp: Call to 'node -e "require('nan')"' returned exit status 1 while in binding.gyp. while trying to load binding.gyp gypgyp ERR! ERR!configure error configure error gypgyp ERR!ERR! stackstack Error: gyp failed with exit code: 1 Error: gyp failed with exit code: 1 gypgyp ERR!ERR! stackstack at ChildProcess.onCpExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16) at ChildProcess.onCpExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16) gypgyp ERR!ERR! stackstack at ChildProcess.emit (events.js:198:13) at ChildProcess.emit (events.js:198:13) gypgyp ERR!ERR! stackstack at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12) at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12) gypgyp ERR!ERR! SystemSystem Linux 4.19.75-v7+ Linux 4.19.75-v7+ gypgyp ERR!ERR! commandcommand "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/home/pi/MagicMirror/modules/MMM-awesome-alexa/node_modules/snowboy/lib/node/binding/Release/node-v64-linux-arm/snowboy.node" "--module_name=snowboy" "--module_path=/home/pi/MagicMirror/modules/MMM-awesome-alexa/node_modules/snowboy/lib/node/binding/Release/node-v64-linux-arm" "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/home/pi/MagicMirror/modules/MMM-awesome-alexa/node_modules/snowboy/lib/node/binding/Release/node-v64-linux-arm/snowboy.node" "--module_name=snowboy" "--module_path=/home/pi/MagicMirror/modules/MMM-awesome-alexa/node_modules/snowboy/lib/node/binding/Release/node-v64-linux-arm" gypgyp ERR!ERR! cwdcwd /home/pi/MagicMirror/modules/MMM-awesome-alexa/node_modules/snowboy /home/pi/MagicMirror/modules/MMM-awesome-alexa/node_modules/snowboy gypgyp ERR!ERR! node -vnode -v v10.18.1 v10.18.1 gypgyp ERR!ERR! node-gyp -vnode-gyp -v v5.0.5 v5.0.5 gypgyp ERR!ERR! not ok not ok node-pre-gyp ERR! build error node-pre-gyp ERR! stack Error: Failed to execute '/usr/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/home/pi/MagicMirror/modules/MMM-awesome-alexa/node_modules/snowboy/lib/node/binding/Release/node-v64-linux-arm/snowboy.node --module_name=snowboy --module_path=/home/pi/MagicMirror/modules/MMM-awesome-alexa/node_modules/snowboy/lib/node/binding/Release/node-v64-linux-arm' (1) node-pre-gyp ERR! stack at ChildProcess. (/home/pi/MagicMirror/modules/MMM-awesome-alexa/node_modules/node-pre-gyp/lib/util/compile.js:83:29) node-pre-gyp ERR! stack at ChildProcess.emit (events.js:198:13) node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:982:16) node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5) node-pre-gyp ERR! System Linux 4.19.75-v7+ node-pre-gyp ERR! command "/usr/bin/node" "/home/pi/MagicMirror/modules/MMM-awesome-alexa/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" node-pre-gyp ERR! cwd /home/pi/MagicMirror/modules/MMM-awesome-alexa/node_modules/snowboy node-pre-gyp ERR! node -v v10.18.1 node-pre-gyp ERR! node-pre-gyp -v v0.6.39 node-pre-gyp ERR! not ok Failed to execute '/usr/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/home/pi/MagicMirror/modules/MMM-awesome-alexa/node_modules/snowboy/lib/node/binding/Release/node-v64-linux-arm/snowboy.node --module_name=snowboy --module_path=/home/pi/MagicMirror/modules/MMM-awesome-alexa/node_modules/snowboy/lib/node/binding/Release/node-v64-linux-arm' (1) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! snowboy@1.3.1 install: node-pre-gyp install --fallback-to-build npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the snowboy@1.3.1 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! /home/pi/.npm/_logs/2020-01-12T16_58_57_599Z-debug.log

vamgan commented 4 years ago

I am getting the same error.

Bernard-h commented 4 years ago

I had the same error, im now trying something different (although the functionallity will be different). Im be running a script with alexapi and magicmirror on the same pi. That module appears to be very fragile and an alexpi install was pretty straightforward and it worked straight away. Maybe that helps..

HabibA007 commented 4 years ago

Have you solved the issue?

raspberrypi9 commented 4 years ago

I know I got past it. Looking back, I think I followed evancohen's advice on: https://github.com/Kitt-AI/snowboy/issues/603 and did: npm install snowboy@sonus.

HabibA007 commented 4 years ago

no, that didn't works for me. I've installed it manually like somebody described it for another plugin which needs snowboy. It works so far, that I successfully did run "npm run config-helper" including getting refreshToken and so on. But after I start magicmirror I get only a blank black screen. In dev mode it tells me: "WARNING! Could not load config file. Starting with default configuration. Error found: Error: Cannot find module '/home/pi/MagicMirror/node_modules/snowboy/lib/node/binding/Release/electron-v3.1-linux-arm/snowboy.node'"

I understand it in that way, that the binary of electron is not build successfully :-(

I'm going crazy with this peace of software

HabibA007 commented 4 years ago

No, it din't works. I've done now the 5th time or so try from beginning and I get everytime the same result by tryin different ways...

I used this instructions:

$ cd ~/MagicMirror/modules # Navigate to module folder $ git clone https://github.com/dolanmiu/MMM-awesome-alexa.git # Clone this repository $ cd MMM-awesome-alexa # go into the module directory $ npm install --only=prod # Install depdendencies $ cd node_modules $ rm -rf snowboy # Remove the installed snowboy $ git clone https://github.com/Kitt-AI/snowboy.git # Manually get snowboy from git $ cd snowboy # Go into the /snowboy directory $ rm -rf node_modules $ npm install nan --save # Make sure you install this in the /snowboy directory $ npm install node-pre-gyp@0.12.0 --save # Make sure you install this in the /snowboy directory $ npm install # Make sure you install in the /snowboy directory $ npm run prepublish # Make sure you run this in the /snowboy directory $ npm install --save-dev electron-rebuild # Make sure you install this in the /snowboy directory $ npm install nan # Make sure you install this in the /snowboy directory $ ./node_modules/.bin/electron-rebuild # Build snowboy to your device specifications, in the /snowboy directory

At the point "$ npm install # Make sure you install in the /snowboy directory" everytime it fails....

HabibA007 commented 4 years ago

Another day and another try from scratch on a new sdcard

I looked at what step I got my first problems. I used the official MM2 instructions to install (manually) and made the "buster" modifications. After that I used the "npm install snowboy@sonus" Binaries instead of "git clone https://github.com/Kitt-AI/snowboy.git # Manually get snowboy from git". After that step I got "found 528 vulnerabilities (6 low, 8 moderate, 514 high)" so I've done a "npm audit fix" like suggested. Next steps "cd snowboy # Go into the /snowboy directory" and "rm -rf node_modules" are without any issues (dir node_modules" doesn't exists with these binaries). Step "npm install nan --save" gives a good output "added 1 package from 8 contributors and audited 1 package in 2.389s found 0 vulnerabilities" aslo the next step: "npm install node-pre-gyp@0.12.0 --save

But now the problems begins: "pi@magicmirror-bath:~/MagicMirror/modules/MMM-awesome-alexa/node_modules/snowboy $ npm install

snowboy@1.3.1-alpha.1 install /home/pi/MagicMirror/modules/MMM-awesome-alexa/node_modules/snowboy node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using request for node-pre-gyp https download [snowboy] Success: "/home/pi/MagicMirror/modules/MMM-awesome-alexa/node_modules/snowboy/lib/node/binding/Release/node-v64-linux-arm/snowboy.node" already installed Pass --update-binary to reinstall or --build-from-source to recompile npm WARN prepublish-on-install As of npm@5, prepublish scripts are deprecated. npm WARN prepublish-on-install Use prepare for build steps and prepublishOnly for upload-only. npm WARN prepublish-on-install See the deprecation note in npm help scripts for more information.

snowboy@1.3.1-alpha.1 prepublish /home/pi/MagicMirror/modules/MMM-awesome-alexa/node_modules/snowboy tsc --listFiles

error TS6053: File '/home/pi/MagicMirror/modules/MMM-awesome-alexa/node_modules/snowboy/lib/node/SnowboyDetectNative.d.ts' not found.

error TS6053: File '/home/pi/MagicMirror/modules/MMM-awesome-alexa/node_modules/snowboy/lib/node/index.ts' not found.

error TS6053: File '/home/pi/MagicMirror/modules/MMM-awesome-alexa/node_modules/snowboy/lib/node/node-pre-gyp.d.ts' not found.

. . . npm ERR! code ELIFECYCLE npm ERR! errno 2 npm ERR! snowboy@1.3.1-alpha.1 prepublish: tsc --listFiles npm ERR! Exit status 2 npm ERR! npm ERR! Failed at the snowboy@1.3.1-alpha.1 prepublish 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! /home/pi/.npm/_logs/2020-02-10T15_54_21_730Z-debug.log"

After that nothing works like it should. It seems that the snowboy build alpha 1 is too old or not that which we need to build the snowboy modules.... What can I try as next?

HabibA007 commented 4 years ago

Wow I solved my problems :-)

First I used the original code for snowboy and get the code to work :-)

First I eleminated (or converted) the output like: "../../../../node_modules/@types/unist/index.d.ts:31:20 - error TS2304: Cannot find name 'unknown'." with installing "npm install --save rxjs" so I run into the next error output.

Now I got "two errors from these types: " node_modules/@types/node/index.d.ts:43:11 - error TS2300: Duplicate identifier 'IteratorResult'.

43 interface IteratorResult { }"

So I removed the line "node_modules/@types/node/index.d.ts" in snowboy/tsconfig.json liked described in an neighbour thread. And now it compiles all modules like a charm.


_ I'm clearly not an expert but editing the tsconfig.json file worked for me:

Change

"files": [ "lib/node/index.ts", "lib/node/node-pre-gyp.d.ts", "lib/node/SnowboyDetectNative.d.ts" "node_modules/@types/node/index.d.ts" ],

into

"files": [ "lib/node/index.ts", "lib/node/node-pre-gyp.d.ts", "lib/node/SnowboyDetectNative.d.ts" ], _ Source User PierreB49: https://github.com/Kitt-AI/snowboy/issues/603

rorschach1969 commented 4 years ago

Would it be possible to list more of your steps? HabibA007? I keep getting the error at the $ npm install --only=prod

najia-samer commented 3 years ago

It would be good to have a troubleshooting guide for this that addresses these problems. I have had the same errors everyone else is having and not being able to move forward is very disappointing. Might have to try my hand at the Google Assistant instead.