witchent / matrix-puppet-signal

A Signal bridge for Matrix
35 stars 2 forks source link

Installation fails "Error: Cannot find module signal-desktop/ts/textsecure" #15

Closed bachrc closed 4 years ago

bachrc commented 4 years ago

Trying to setup the bridge on a server, but the npm run link seems broken :

root@matrix-bots:~/matrix-puppet-signal# npm run link

> matrix-puppet-signal@2.0.0 link /root/matrix-puppet-signal
> node -e "new (require('signal-client'))('matrix').link()"

internal/modules/cjs/loader.js:969
  throw err;
  ^

Error: Cannot find module '/root/matrix-puppet-signal/node_modules/signal-desktop/ts/textsecure'
Require stack:
- /root/matrix-puppet-signal/node_modules/signal-client/index.js
- /root/matrix-puppet-signal/[eval]
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:966:15)
    at Function.Module._load (internal/modules/cjs/loader.js:842:27)
    at Module.require (internal/modules/cjs/loader.js:1026:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at signalRequire (/root/matrix-puppet-signal/node_modules/signal-client/index.js:17:35)
    at Object.<anonymous> (/root/matrix-puppet-signal/node_modules/signal-client/index.js:88:21)
    at Module._compile (internal/modules/cjs/loader.js:1138:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
    at Module.load (internal/modules/cjs/loader.js:986:32)
    at Function.Module._load (internal/modules/cjs/loader.js:879:14)
    at Module.require (internal/modules/cjs/loader.js:1026:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at [eval]:1:6
    at Script.runInThisContext (vm.js:120:20)
    at Object.runInThisContext (vm.js:311:38)
    at Object.<anonymous> ([eval]-wrapper:10:26) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/root/matrix-puppet-signal/node_modules/signal-client/index.js',
    '/root/matrix-puppet-signal/[eval]'
  ]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! matrix-puppet-signal@2.0.0 link: `node -e "new (require('signal-client'))('matrix').link()"`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the matrix-puppet-signal@2.0.0 link 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!     /root/.npm/_logs/2020-07-13T10_16_57_458Z-debug.log

Did this happen to someone?

witchent commented 4 years ago

Most probably there was some error while npm installing. Try cd into node_modules/signal-desktop and run "yarn && yarn grunt", and if that does not help try to clone into a fresh directory and run npm install again.

bachrc commented 4 years ago

Ok, this worked ! Thanks for your quick answer. :) I can do a PR specifying this additional step, or do you want to do it ?

witchent commented 4 years ago

This is not an additional step, this is normally done by the postscript of "npm install". So something went wrong while you tried to install it. I might add that to the FAQ at one point though, let's see. Have fun with the bridge anyway

bachrc commented 4 years ago

Yeah, I saw it in the install script, but I can assure you that it hasn't been done by the npm install. :/ I have Node 12 and NPM 6.

Thanks a lot for your work !

witchent commented 4 years ago

Yea apparently sometimes npm does not execute the post install script for some unknown reasons (never happened to me).

And you're welcome, glad to know people are using it and it is working.