Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After installing decktape I got following error: #124

Closed
ottlukas opened this issue Nov 18, 2017 · 13 comments
Closed

After installing decktape I got following error: #124

ottlukas opened this issue Nov 18, 2017 · 13 comments

Comments

@ottlukas
Copy link

ottlukas commented Nov 18, 2017

decktape -h
module.js:538
    throw err;
    ^

Error: Cannot find module '/usr/lib/node_modules/decktape/node_modules/hummus/binding/hummus.node'
    at Function.Module._resolveFilename (module.js:536:15)
    at Function.Module._load (module.js:466:25)
    at Module.require (module.js:579:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/usr/lib/node_modules/decktape/node_modules/hummus/hummus.js:5:31)
    at Module._compile (module.js:635:30)
    at Object.Module._extensions..js (module.js:646:10)
    at Module.load (module.js:554:32)
    at tryModuleLoad (module.js:497:12)
    at Function.Module._load (module.js:489:3)
@astefanutti
Copy link
Owner

It looks like the installation of the Hummus dependency has not completed successfully. Could you look at the DeckTape installation log and check if there is no error?

@ottlukas
Copy link
Author

ottlukas commented Nov 18, 2017

You are right!

2322 verbose Linux 4.10.0-38-generic
2323 verbose argv "/usr/bin/node" "/usr/bin/npm" "install" "-g" "hummus"
2324 verbose node v8.9.1
2325 verbose npm  v5.5.1
2326 error code ELIFECYCLE
2327 error errno 1
2328 error hummus@1.0.83 install: `node-pre-gyp install --fallback-to-build`
2328 error Exit status 1
2329 error Failed at the hummus@1.0.83 install script.
2329 error This is probably not a problem with npm. There is likely additional logging output above.
2330 verbose exit [ 1, true ]

What can I do about it?

@astefanutti
Copy link
Owner

Could you try (re-)installing node-gyp: https://github.com/nodejs/node-gyp#installation

@ottlukas
Copy link
Author

ottlukas commented Nov 18, 2017

Still same error after

sudo npm install -g node-gyp
/usr/bin/node-gyp -> /usr/lib/node_modules/node-gyp/bin/node-gyp.js
+ node-gyp@3.6.2
updated 1 package in 2.292s

This command "sudo npm install -g hummus" leads to this output (so maybe wrong git here):

2319 verbose stack Error: hummus@1.0.83 install: `node-pre-gyp install --fallback-to-build`
2319 verbose stack Exit status 1
2319 verbose stack     at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:280:16)
2319 verbose stack     at emitTwo (events.js:126:13)
2319 verbose stack     at EventEmitter.emit (events.js:214:7)
2319 verbose stack     at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
2319 verbose stack     at emitTwo (events.js:126:13)
2319 verbose stack     at ChildProcess.emit (events.js:214:7)
2319 verbose stack     at maybeClose (internal/child_process.js:925:16)
2319 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
2320 verbose pkgid hummus@1.0.83
2321 verbose cwd /home/lukas
2322 verbose Linux 4.10.0-38-generic
2323 verbose argv "/usr/bin/node" "/usr/bin/npm" "install" "-g" "hummus"
2324 verbose node v8.9.1
2325 verbose npm  v5.5.1
2326 error code ELIFECYCLE
2327 error errno 1
2328 error hummus@1.0.83 install: `node-pre-gyp install --fallback-to-build`
2328 error Exit status 1
2329 error Failed at the hummus@1.0.83 install script.
2329 error This is probably not a problem with npm. There is likely additional logging output above.
2330 verbose exit [ 1, true ]

@astefanutti
Copy link
Owner

Have you checked that you have all the node-gyp requirements (gcc, python 2.7, ...)? Could you provide the full install log?

@ottlukas
Copy link
Author

ottlukas commented Nov 18, 2017

2017-11-18T13_33_58_078Z-debug.log

python --version
Python 2.7.12

gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.5)
GNU Make 4.1

@astefanutti
Copy link
Owner

Would you be able to run the following command:

node-pre-gyp install --fallback-to-build

So we may get more info?

@ottlukas
Copy link
Author

After execution

node-pre-gyp info it worked if it ends with ok
node-pre-gyp info using node-pre-gyp@0.6.39
node-pre-gyp info using node@8.9.1 | linux | x64
node-pre-gyp ERR! UNCAUGHT EXCEPTION 
node-pre-gyp ERR! stack Error: ENOENT: no such file or directory, open './package.json'
node-pre-gyp ERR! stack     at Object.fs.openSync (fs.js:646:18)
node-pre-gyp ERR! stack     at Object.fs.readFileSync (fs.js:551:33)
node-pre-gyp ERR! stack     at install (/usr/lib/node_modules/node-pre-gyp/lib/install.js:144:38)
node-pre-gyp ERR! stack     at Object.self.commands.(anonymous function) [as install] (/usr/lib/node_modules/node-pre-gyp/lib/node-pre-gyp.js:50:37)
node-pre-gyp ERR! stack     at run (/usr/lib/node_modules/node-pre-gyp/bin/node-pre-gyp:82:30)
node-pre-gyp ERR! stack     at Object.<anonymous> (/usr/lib/node_modules/node-pre-gyp/bin/node-pre-gyp:134:1)
node-pre-gyp ERR! stack     at Module._compile (module.js:635:30)
node-pre-gyp ERR! stack     at Object.Module._extensions..js (module.js:646:10)
node-pre-gyp ERR! stack     at Module.load (module.js:554:32)
node-pre-gyp ERR! stack     at tryModuleLoad (module.js:497:12)
node-pre-gyp ERR! System Linux 4.10.0-38-generic
node-pre-gyp ERR! command "/usr/bin/node" "/usr/bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /home/lukas
node-pre-gyp ERR! node -v v8.9.1
node-pre-gyp ERR! node-pre-gyp -v v0.6.39
node-pre-gyp ERR! This is a bug in `node-pre-gyp`.
node-pre-gyp ERR! Try to update node-pre-gyp and file an issue if it does not help:
node-pre-gyp ERR!     <https://github.com/mapbox/node-pre-gyp/issues>

node-inspector/v8-debug#7

@astefanutti
Copy link
Owner

I would try something like:

$ npm cache clean
$ sudo npm install -g --unsafe-perm hummus
$ sudo npm install -g --unsafe-perm decktape

@ottlukas
Copy link
Author

ottlukas commented Nov 20, 2017

 $ sudo npm cache verify
Cache verified and compressed (~/.npm/_cacache):
Content verified: 313 (21442271 bytes)
Index entries: 480
Finished in 0.764s
$ sudo npm install -g --unsafe-perm hummus

> hummus@1.0.83 install /usr/lib/node_modules/hummus
> node-pre-gyp install --fallback-to-build

[hummus] Success: "/usr/lib/node_modules/hummus/binding/hummus.node" is installed via remote
+ hummus@1.0.83
added 113 packages in 6.979s
$ sudo npm install -g --unsafe-perm decktape
/usr/bin/decktape -> /usr/lib/node_modules/decktape/decktape.js
+ decktape@2.5.0
updated 1 package in 2.116s

Still same result:

decktape -h
module.js:538
    throw err;
    ^

Error: Cannot find module '/usr/lib/node_modules/decktape/node_modules/hummus/binding/hummus.node'
    at Function.Module._resolveFilename (module.js:536:15)
    at Function.Module._load (module.js:466:25)
    at Module.require (module.js:579:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/usr/lib/node_modules/decktape/node_modules/hummus/hummus.js:5:31)
    at Module._compile (module.js:635:30)
    at Object.Module._extensions..js (module.js:646:10)
    at Module.load (module.js:554:32)
    at tryModuleLoad (module.js:497:12)
    at Function.Module._load (module.js:489:3)

$ npm -v
5.5.1
$ node -v
v8.9.1

@astefanutti
Copy link
Owner

It's very surprising the Hummus binding install correctly in /usr/lib/node_modules/hummus/binding/hummus.node while it's not in /usr/lib/node_modules/decktape/node_modules/hummus/binding/hummus.node.

By any chance, could you try copying the former to the later and see how that goes?

@ottlukas
Copy link
Author

That solved the issue:

 /usr/lib/node_modules/decktape/node_modules/hummus $ sudo mkdir binding
/usr/lib/node_modules/decktape/node_modules/hummus $ sudo cp /usr/lib/node_modules/hummus/binding/hummus.node /usr/lib/node_modules/decktape/node_modules/hummus/binding/hummus.node

Result:

 $ decktape -h

Usage: decktape [options] [command] <url> <filename>
       decktape version

command      one of: automatic, bespoke, csss, deck, dzslides, flowtime, generic, impress, remark, reveal, rise, shower-1.x, shower-2.x, slidy, webslides
url          URL of the slides deck
filename     Filename of the output PDF file

Options:
   -s <size>, --size <size>        Size of the slides deck viewport: <width>x<height>  (ex. 1280x720)
   -p <ms>, --pause <ms>           Duration in milliseconds before each slide is exported  [1000]
   --load-pause <ms>               Duration in milliseconds between the page has loaded and starting to export slides  [0]
   --screenshots                   Capture each slide as an image  [false]
   --screenshots-directory <dir>   Screenshots output directory  [screenshots]
   --screenshots-size <size>       Screenshots resolution, can be repeated
   --screenshots-format <format>   Screenshots image format, one of [jpg, png]  [png]
   --slides <range>                Range of slides to be exported, a combination of slide indexes and ranges (e.g. '1-3,5,8')

Defaults to the automatic command.
Iterates over the available plugins, picks the compatible one for presentation at the
specified <url> and uses it to export and write the PDF into the specified <filename>.

Thank you! :) 👍

@7Moses
Copy link

7Moses commented Feb 26, 2018

The above did not work for me or I could not figure it out, but this did:

$ cd /usr/local/lib/node_modules/decktape/node_modules/
$ npm rebuild hummus --update-binary  

(Learnt here: https://stackoverflow.com/questions/45761864/nodejs-how-to-fix-different-node-module-version/45762265#45762265)

... back in production

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants