Production Mode and Bcrypt Issues on v 0.5.1


#1

Hello,

@Scott Thanks for an awesome CMS, makes developing sites a breeze.

Following the steps outline by @cmall in his article https://mallinson.ca/posts/12/vapid-on-digital-ocean, I successfully installed vapid with pm2. Thanks for the article, very helpful and very appreciated.

However, as I needed to setup another site, it seems there are issues running in production mode, something I did not encounter in the first installed. Node seems to be killing the process everything its restarted by pm2. Its fine when I run in development directly using vapid start but it will not work when I sue pm2 even when I change the NODE_ENV to production mode and running vapid start it would not run.

I also tried to install the latest version 0.5.1 and bcrypt would not install at all. I am running the install on ubuntu 18.04 node 10.15 and nom 6.4.1

I also tried to update the running instance from v 0.3.5 to v 0.5.1 and it would not update due to the bcrypt issue

Would appreciate any feedback as to what might be the issue/s.

Thanks & Regards
Said


#2

@Said Are you seeing any (bcrypt) error messages when you try to update from 0.3.5 to 0.5.1? If so, let me know, and I can help you troubleshoot.


#3

@Scott

Thanks for getting back, I managed find a way around it by starting the install using node 8.10.0 and after the install I update to the latest node version.

The issue with bcrypt seems to be an incompatibility with node v10.15.0 during the install stage. Oddly enough, when I installed with version 8.10.0 no issues.

Regards


#4

@Scott

Seems that what I did above seems to have reverted for some reason. I’m getting the following error when I try to start vapid after updating to v10.x.x

    vapid start
/usr/local/lib/node_modules/@vapid/cli/node_modules/bindings/bindings.js:91
        throw e
        ^

Error: The module '/usr/local/lib/node_modules/@vapid/cli/node_modules/sharp/build/Release/sharp.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 57. This version of Node.js requires
NODE_MODULE_VERSION 64. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:718:18)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at bindings (/usr/local/lib/node_modules/@vapid/cli/node_modules/bindings/bindings.js:84:48)
    at Object.<anonymous> (/usr/local/lib/node_modules/@vapid/cli/node_modules/sharp/lib/constructor.js:10:34)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)

Vapid version 0.5.1
Linux 18.10
Node v10.15.0
npm 6.4.1

Thanks


#5

@Said Have you already tried issuing the npm rebuild command?


#6

@Scott, sorry just got back. Yes I did and it made no difference.

The odd thing about it is that the same site works fine on my Mac, but not when the server.

Thanks


#7

@Said Are you sharing the code between you Mac and server with Git? If so, are you committing node_modules to the repo, or installing the NPM modules on the server?


#8

@Scott

Nope, completely different instances. I should have pointed out that when I ran the Server instance on my Mac it did run without issues because I have version 0.5.1 on my Mac

Its only when I updated the to Node v10.15.0 and npm 6.4.1 on the server did I get that error.

Apologies for the confusion.

Regards


#9

@Said Have you tried uninstalling/reinstalling Vapid?

npm uninstall -g @vapid/cli
npm install -g @vapid/cli

#10
@Scott

I did that as well.

I’m going to try and do a complete fresh install and will document the results. Will share when I have done. Basically, its only happening on Ubuntu and only when I upgrade to version 0.5.1

Thanks & Regards