pm2 'cluster' mode fail to load LD_LIBRARY_PATH - c++

i'm installing a npm package ccap to generate CAPTCHA. Because it's a c++ add on and requires gcc 4.8 +,i met some problems while installing it.
I compiled gcc 4.9.4 and installed ccap successfully on my development machine.
However ,i met this wield problem when i try to start my application (without pm2).
Error: /usr/lib64/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by /home/jwb/ccapDemo/node_modules/ccap/build/Release/hcaptha.node)
at Error (native)
at Object.Module._extensions..node (module.js:597:18)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Function._load (/home/jwb/ccapDemo/node_modules/pmx/lib/transaction.js:47:40)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/home/jwb/ccapDemo/node_modules/ccap/lib/hcap.js:4:13)
at Module._compile (module.js:570:32)
I googled a lot and got it fixed by setting following linux enviroment variable in .bash_profile.
export LD_LIBRARY_PATH=/home/jwb/gcc-4.9.4/lib64:$LD_LIBRARY_PATH
Now it seems like working ,but when i try to start my demo in PM2 cluster mode,the same problem occured.
I also tried pm2 fork mode,and it worked just fine.
So i figured maybe LD_LIBRARY_PATH can not be found in PM2 cluster mode.Then i printed process.env and found LD_LIBRARY_PATH.
So i think this problem is somehow related to PM2 cluster mode ,but i don't know how to fix it.
I do not have root authority and can not just update /usr/lib64/libstdc++.so.6 to a higher version. Have someone met same problem ?How should i solve it?
Software versions used
OS : Red Hat 6
gcc : 4.9.4 (default gcc version is 4.4.7)
node.js : 6.9.1
PM2 : 2.0.19

Related

Module did not self-register. Electron app using a custom build c++ node module compiled with cmake-js

Working on a project. Built a C++ module for node, compiled it with cmake. I tried using the module in my main electron app but it errors out.
Reproduced it with a minimal repo here: https://github.com/Aerrus/electronMinimal
App threw an error during load
Error: Module did not self-register.
at process.module.(anonymous function) [as dlopen] (ELECTRON_ASAR.js:160:31)
at Object.Module._extensions..node (internal/modules/cjs/loader.js:722:18)
at Object.module.(anonymous function) [as .node] (ELECTRON_ASAR.js:160:31)
at Module.load (internal/modules/cjs/loader.js:602:32)
at tryModuleLoad (internal/modules/cjs/loader.js:541:12)
at Function.Module._load (internal/modules/cjs/loader.js:533:3)
at Module.require (internal/modules/cjs/loader.js:640:17)
at require (internal/modules/cjs/helpers.js:20:18)
at bindings (C:\Users\xxx\electronMinimal\mods\node_modules\bindings\bindings.js:112:48)
at Object.<anonymous> (C:\Users\xxx\electronMinimal\mods\index.js:1:188)
Saw a lot of threads already about rebuilding it, making sure the node version when I built it was the same, and so on. None of them changed anything.
If you're using electron v4.0
take a look at this. I hope it helped because that's how I solved the problem
adding delay hook to cmakelist using cmake-js

ArchLinux Fails to Run Latest GitKraken (3.3.4)

I'm trying to run 64 bit zipped GitKraken on an ArchLinux build machine (where I do not have super privileges), and the latest version of GitKraken (3.3.4) seems to have changed/broken something with lib curl.
With a previous release (3.1.1, 64 bit), I was able to run just by calling gitkraken. Then, at some point, I had to preload the correct (older) curl library like so to get GK to run:
LD_PRELOAD=/usr/lib/libcurl.so.3 ~/gitkraken/gitkraken.
With 3.3.4, it won't run with using the direct call to gitkraken:
/usr/lib/libcurl.so.4: version `CURL_OPENSSL_3' not found (required by
/home/kmiller/gitkraken/resources/app.asar.unpacked/node_modules/nodegit/build/Release/nodegit.node)),
If I do specify it, it seg faults:
LD_PRELOAD=/usr/lib/libcurl.so.3 ~/gitkraken/gitkraken Node started
time: 1519142744860 Segmentation fault (core dumped)
If I specify libcurl4, it wants version 3:
LD_PRELOAD="/usr/lib/libcurl.so.4" ~/gitkraken/gitkraken Node started
time: 1519154390224 /usr/lib/libcurl.so.4: version CURL_OPENSSL_3'
not found (required by
/home/kmiller/gitkraken/resources/app.asar.unpacked/node_modules/nodegit/build/Release/nodegit.node)
Error: /usr/lib/libcurl.so.4: versionCURL_OPENSSL_3' not found
(required by
/home/kmiller/gitkraken/resources/app.asar.unpacked/node_modules/nodegit/build/Release/nodegit.node)
at process.module.(anonymous function) [as dlopen] (ELECTRON_ASAR.js:173:20)
at Object.Module._extensions..node (module.js:598:18)
at Object.module.(anonymous function) [as .node] (ELECTRON_ASAR.js:187:18)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at Object. (/home/kmiller/gitkraken/resources/app.asar/node_modules/nodegit/dist/nodegit.js:11:12)
at Object. (/home/kmiller/gitkraken/resources/app.asar/node_modules/nodegit/dist/nodegit.js:1031:3)
Thank you in advance. GitKraken help sent me here :slightly_smiling_face:
Solution:
The preload library for 3.3.4 is gnutls, you can then run GitKraken like this:
LD_PRELOAD=/usr/lib/libcurl-gnutls.so.3 ~/gitkraken/gitkraken

node Sass Support to current version environment (Ionic)

in the ionic app
trying to run ionic emulate ios but following error is coming
ionic-hello-world# ionic:build /Users/farrukhqamar/HybridApps/helloWorld
ionic-app-scripts build
keywords if/then/else require v5 option
/Users/farrukhqamar/HybridApps/helloWorld/node_modules/node-sass/lib/index.js:13
throw new Error(errors.unsupportedEnvironment());
^
Error: Node Sass does not yet support your current environment: OS X 64-bit with Unsupported runtime (51)
For more information on which environments are supported please see:
https://github.com/sass/node-sass/releases/tag/v3.10.1
at Object. (/Users/farrukhqamar/HybridApps/helloWorld/node_modules/node-sass/lib/index.js:13:11)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at Object. (/Users/farrukhqamar/HybridApps/helloWorld/node_modules/#ionic/app-scripts/dist/sass.js:11:19)
at Module._compile (module.js:571:32)
In the morning every thing was working but just start happening now in my current project
If i create a new project then it runs perfectly.
I am very new in ionic so please suggest some solution
Runtime (Node Module ABI) version 51 means it's an Electron environment, which node-sass doesn't directly support.

ember-cli gives "Unexpected end of JSON input"

I have recent node (7.1.0) and npm (4.0.2) installations on macOS Sierra 10.12.1 with Xcode 8.1. The installation of the ember-cli package seems to work fine apart from two warnings:
08:51 $ npm install -g ember-cli
npm WARN deprecated node-uuid#1.4.7: use uuid module instead
npm WARN deprecated minimatch#2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
/usr/local/bin/ember -> /usr/local/lib/node_modules/ember-cli/bin/ember
/usr/local/lib
└── ember-cli#2.9.1
But when I call ember it always gives me the following error:
08:52 $ ember --help
module.js:593
throw err;
^
SyntaxError: /Users/torstenkemps-benedix/package.json: Unexpected end of JSON input
at JSON.parse (<anonymous>)
at Object.Module._extensions..json (module.js:590:27)
at Module.load (module.js:490:32)
at tryModuleLoad (module.js:449:12)
at Function.Module._load (module.js:441:3)
at Module.require (module.js:500:17)
at require (internal/module.js:20:19)
at Function.Project.getProjectRoot (/usr/local/lib/node_modules/ember-cli/lib/models/project.js:662:13)
at module.exports (/usr/local/lib/node_modules/ember-cli/lib/cli/index.js:76:22)
at /usr/local/lib/node_modules/ember-cli/bin/ember:27:3
How can I get ember to run correctly?

Unable to use ember-cli without manually deleting "tmp" directory after every command

I am new to Ember and just installed the ember-cli:
npm install -g ember-cli
and it seems to install fine:
D:\>ember -v
ember-cli: 2.7.0
node: 4.4.5
os: win32 x64
When I repeat the identical version command (ember -v), I get the following error message:
D:\>ember -v
fs.js:794
return binding.mkdir(pathModule._makeLong(path),
^
Error: EEXIST: file already exists, mkdir 'D:\tmp'
at Error (native)
at Object.fs.mkdirSync (fs.js:794:18)
at testCanSymlink (C:\Users\joeal_000\AppData\Roaming\npm\node_modules\ember-cli\node_modules\symlink-or-copy\index.js:18:6)
at Object.<anonymous> (C:\Users\joeal_000\AppData\Roaming\npm\node_modules\ember-cli\node_modules\symlink-or-copy\index.js:9:15)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
The first "ember -v" command creates a directory named "tmp" in directory that I am in when I issue the "ember" command. If I delete this "tmp" directory, everything works fine again:
D:\>rmdir /s tmp
tmp, Are you sure (Y/N)? y
D:\>ember -v
ember-cli: 2.7.0
node: 4.4.5
os: win32 x64
Here are my versions of node and npm:
D:\>node -v
v4.4.5
D:\>npm -v
2.15.5
How can I stop this behavior from occurring, whever I have to delete the "tmp" file after every ember command?
Thanks for the help.
ember-cli temporarily broken because of a dependent package.
The issue was resolved a few minutes ago: https://github.com/broccolijs/node-symlink-or-copy/issues/26#event-746775676
Just do npm install again after deleting your nodes_module directory.
try deleting all node modules directory, and do npm install, or better place your ember not in C drive