Closed kevincittadini closed 7 years ago
I think it means that make script cannot find OpenSSL.
$ brew --prefix openssl
You should see smth like /usr/local/opt/openssl
$ which openssl
to make sure that MacOS knows the path to openssl.
make install CRYPTO_ENGINE_PATH=openssl CRYPTO_ENGINE_INCLUDE_PATH=<path_to_openssl>/openssl/include CRYPTO_ENGINE_LIB_PATH=<path_to_openssl>/openssl/lib
These params define to use openssl directly. On my Mac command looks like this:
make install CRYPTO_ENGINE_PATH=openssl CRYPTO_ENGINE_INCLUDE_PATH=/usr/local/opt/openssl/include CRYPTO_ENGINE_LIB_PATH=/usr/local/opt/openssl/lib
but it might be different in your case
Yes, running the last command successfully installs Themis via Make. Thanks a lot.
This said, the problem with npm install
remains. Different error though.
1 warning generated.
SOLINK_MODULE(target) Release/jsthemis.node
clang: error: no such file or directory: '/usr/lib/libthemis.a'
clang: error: no such file or directory: '/usr/lib/libsoter.a'
make: *** [Release/jsthemis.node] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack at emitTwo (events.js:125:13)
gyp ERR! stack at ChildProcess.emit (events.js:213:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Darwin 16.7.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build"
gyp ERR! cwd /path/to/node_modules/jsthemis
gyp ERR! node -v v8.6.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm WARN lottie-react-native@1.1.1 requires a peer of react@>=15.3.1 but none is installed. You must install peer dependencies yourself.
npm WARN react-native-branch@2.0.0-beta.3 requires a peer of react@>=15.4.0 but none is installed. You must install peer dependencies yourself.
npm WARN react-native-gesture-handler@1.0.0-alpha.23 requires a peer of react@> 15.0.0 but none is installed. You must install peer dependencies yourself.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! jsthemis@0.9.5 preinstall: `node-gyp configure && node-gyp build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the jsthemis@0.9.5 preinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
It's our fault, we strictly use /usr/lib/
path instead of /usr/local/lib
preferred on MacOS.
We've pushed super-small fix #238, however, it takes time to re-build and re-distribute the lib.
@kevincittadini can you please check changes locally?
src/wrappers/themis/jsthemis/
folder$ node-gyp configure && node-gyp build
3.5 Install nan if it's not found (npm install nan
)
Please let me know if it helped, we will update npm package then.
Thank you!
Success. No errors given. Everything seems nice and ok. So, will I have to wait till the package is updated right?
Thank you so much for your fast reply and solutions.
Consider this as quick hack :) You can use this workaround as quick solution, we will update package next days. I'll let you know right after we publish update :)
So, I've copied the full directory jsthemis
(after the $ node-gyp configure && node-gyp build
) inside the node_modules
directory of my project. Is this the right way?
This is my code
var themis = require('themis');
Node throws this error:
Unable to resolve module 'jsthemis'
I'm surely missing something :)
var themis = require('jsthemis');
is correct and now you can try just npm install jsthemis
inside your project directory (we published fixed jsthemis package to npmjs registry)
After running npm install jsthemis, the console is looping on this
jsthemis@0.9.6-1 preinstall /path/to/node_modules/jsthemis
npm install && node-gyp configure && node-gyp build
This 2 lines keeps echoing
yeah, my fault, sorry
until we fix that, you can try your previous steps (with manual building with node-gyp) and import jsthemis
package instead themis
: var themis = require('jsthemis');
This is my folder structure now under /path/to/node_modules/jsthemis/
I'm using ReactNative now, and in my .js file, when I import the package with:
var themis = require('jsthemis');
The system goes
Unable to resolve module 'jsthemis' from File.js: Module does not exist in the module map or in these directories: /path/to/node_modules
Before you ask: Yes, I tried to rebuild everything and clear various caches. Still got "unable to resolve module 'jsthemis'".
please try now npm install jsthemis
or pull new changes from our repository (git pull
) and install to your project with npm install /absolute/path/themis/src/wrappers/themis/jsthemis
from sources
Ok, no installation problems. Thank you for that.
Still Unable to resolve module 'jsthemis' from File.js: Module does not exist in the module map or in these directories: /path/to/node_modules
error remains.
as I understand now you have next structure:
project_folder:
- node_modules
- - module1
- - module2
- - jsthemis
- some.js
- some2.js
jsthemis
in node_modules?node -e "require('jsthemis');"
inside No errors running that on console. No output at all in fact. I'm using ReactNative. Also tried to wipe all caches.
if no errors and empty output then nodejs can find jsthemis correctly and the problem somewhere else (https://github.com/facebook/react-native/issues/14209 maybe this will help)
I can confirm that jsthemis works fine now as of version 0.9.6-3. Of course outside of ReactNative. I tried it in a classic index.js file and works fine.
Thanks a lot for your support and your fast replies.
Thank you @kevincittadini for reaching out :) You helped to make Themis better :)
If I run the command
make install
in the just cloned Themis repo, i get this errorIf then I try to install
jsthemis
this is the error givenI've OpenSSL and LibreSSL installed via Homebrew. I've tried to solve all
brew doctor
notices.I'm on macOS Sierra 10.12.6
I also do believe that some needed libraries are under
/usr/lib
whilst perhaps they should be under/usr/local/lib
? There's a missing/usr/include
folder as well.