bcrypt error after upgrading nodejs gear to v0.12 on Openshift - linux

After upgrading the nodejs version running on my Openshift's gear from v0.10 to v0.12, I get the following error:
Error: /app-root/runtime/repo/node_modules/bcrypt/build/Release/bcrypt_lib.node: undefined
symbol: node_module_register
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at bindings (/app-root/runtime/repo/node_modules/bcrypt/node_modules/bindings/bindings.js:76:44)
at Object.<anonymous> (/app-root/runtime/repo/node_modules/bcrypt/bcrypt.js:3:35)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
The bcrypt version in my package.json is set to ~0.8.5.
So far I have tried these without success:
- rhc ssh myapp then update node-gyp, rm -rf node_modules and npm install;
- manually installed the dependencies;
- edited package.json to preinstall node-gyp
"scripts":{
"preinstall": "npm i -g node-gyp && node-gyp clean"
}
anyone has an idea / knows on how I can solve this? (ideally the solution won't require to upgrade gcc)
Also, I am using Ryan J's custom cartridge for nodejs v.012

I finally solved it with a workaround by editing .openshift\lib\utils and adding export OPENSHIFT_NODEJS_VERSION=0.6 in the setup_path_for_custom_node_version() function:
# Add the node binary path to the PATH.
export OPENSHIFT_NODEJS_VERSION=0.6
export PATH="$node_bin_path:${PATH}"

Related

Express not working with node 9.x

I have an Ubuntu box with node - v 9.5.0 and npm - 5.6.0 versions. I am trying to use expressjs (http://expressjs.com), but unable to run it. It works fine for node v 4.x.x.
$ express -h
module.js:557
throw err;
^
Error: Cannot find module 'commander'
at Function.Module._resolveFilename (module.js:555:15)
at Function.Module._load (module.js:482:25)
at Module.require (module.js:604:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/usr/lib/nodejs/express-generator/bin/express:3:15)
at Module._compile (module.js:660:30)
at Object.Module._extensions..js (module.js:671:10)
at Module.load (module.js:573:32)
at tryModuleLoad (module.js:513:12)
at Function.Module._load (module.js:505:3)
What is it that I am missing here?
Ubuntu's packages seem to be outdated.
Installing using apt-get node-express-generator gives this error.
Installing using npm i -g express-generator works fine.
Please try to follow the preceding steps.
Install the current version of NodeJS
Uninstall all modules with npm uninstall and rm -fr ~/.npm
Reinstall express-generator
Hope it helps.

Gulp watch not working - cannot find module connect

Trying to run my project using gulp (havent used gulp before and have inherited an exisiting project).
I install the dependencies into the wordpress theme directory.
Running gulp watch throws this error:
Error: Cannot find module 'connect'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (C:\dev\projects\romac-website\web\app\themes\romac\node_modules\browser-sync\lib\utils.js:307:31)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
I have tried to update npm but not sure if it is fine or the problem (still).
I also tried to ins install this module with npm -g install connect
What should I try next?
Try deleting the node-modules folder then reinstall npm install connect --save-dev Then retry running gulp

I cant run ionic serve

Can somebody help me? I'm new in ionic. When I try to run serve, this error appears. I ran sudo npm install -g cordova, but the error came back.
Error: Cannot find module 'xmlbuilder'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object. (/usr/local/lib/node_modules/ionic/node_modules/xml2js/lib/xml2js.js:12:13)
at Object. (/usr/local/lib/node_modules/ionic/node_modules/xml2js/lib/xml2js.js:436:4)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
Try removing them and reinstalling
npm cache clean
npm uninstall -g cordova ionic
npm install -g cordova ionic
Use sudo if you are on a mac or a linux.
are you sure you're in the project directory? As in assuming you created your app on the desktop, are you sure you're not in C://Users/username/Desktop instead of C://Users/username/Desktop/myApp ?

Meteor bundle error on startup

I have an issue with meteor bundle. I try to start bundle with foreverjs but get error
root#ip-172-31-0-83:/home/ubuntu/bundle# cat ../logs/forever.log
module.js:340
throw err;
^
Error: Cannot find module 'fibers'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/home/ubuntu/bundle/programs/server/boot.js:1:75)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
error: Forever detected script exited with code: 8
I tried install fibers via npm
npm install fibers -g
,also I've tried install in local meteor node_modules dir.
But unfortunately error stays.
Version of meteor is 0.9.1.1
The procedure to install Fibers has changed in 0.9.x+
From the docs:
cd bundle
cd programs/server
npm install
Also, the correct setup instructions (for a bundle built by any version of Meteor) can be found in the bundle's README file.

Apparently I deleted some of the files on the node_module, how can I restore them?

I was trying to install node trough brew and it was giving a lot of errors, and apparently some file was not giving the permission, so I thunked that the file was from other failed try to intall node and I decide to remove the directory. It failed to remove the dir and the files, but apparently some had been erased.
They are:
module.js:340
throw err;
^
Error: Cannot find module 'child-process-close'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at /usr/local/lib/node_modules/npm/lib/npm.js:15:1
at Object. (/usr/local/lib/node_modules/npm/lib/npm.js:461:3)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
How can I solve this? I just wanted to try sails.js for fun, but I didn't see any fun time yet, only problems.
Thank you
It appears that your issue is not with the sails global or project installation, but rather that you corrupted the nodejs installation. I'd recommend you to just download nodjs again from nodejs.org (this downloads a .pkg) and install it with that package.
If this complains about permissions and overwriting things (which I don't think), try first deleting the whole node_modules folder with sudo:
sudo rm -fr /usr/local/lib/node_modules
I know this is super late. However, I was getting this same error while trying get a react native app up and running.
I installed node with HomeBrew and after getting the following:
Error: Cannot find module 'child-process-close'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:278:25)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at /usr/local/lib/node_modules/npm/lib/npm.js:15:1
at Object.<anonymous> (/usr/local/lib/node_modules/npm/lib/npm.js:520:3)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
I then ran
brew postinstall node
and got:
Permission denied - /usr/local/lib/node_modules/npm/AUTHORS
So then I ran:
sudo brew postinstall node
and it seemed to work fine. I could go about installing waterline, firebase, or whatever else I tried.
Hope this helps!
Run npm install from your project directory to re-install all modules listed in your package.json.

Resources