How to run Argon2 on a Node.js server on Google Cloud Platform?

471 Views Asked by At

I'm curently building a web app on Google App Engine Standard env. using Node.js 10.16.3. I would like to use Argon2 package. Unfortunately, I can't figure out how to install it locally on Windows7 and have no idea how on gcloud either.

It is said on the package page that:

"Before installing : You MUST have a node-gyp global install before proceeding with install, along with GCC >= 5 / Clang >= 3.3. On Windows, you must compile under Visual Studio 2015 or newer."

I've installed node-gyp globally npm install -g node-gyp as well as Python lastest version which is required. I also installed GCC and then used npm install argon2 to install the package where my project is. I'm not sure to understand the Visual Studio part.

When trying to run the serveur with npm start, I get this error:

Error: myproject\node_modules\argon2\lib\binding\argon2.node is not a valid application
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:807:18)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.<anonymous> (C:\Users\me\myproject\node_modules\argon2\argon2.js:9:56)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.<anonymous> (C:\Users\me\myproject\www\server\server.js:3:16)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `node www/server/server.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional log
ging output above.

Am I missing something ? node-gyp are also not recognized

1

There are 1 best solutions below

0
On

I found the following feature request about implementing the library in GAE standard, this is also interesting, can you try to do this with GAE flex? I think the library might not be implemented in standard. As in flex you have customizable runtimes, it might allow you to do it.

Have a look at this other thread as well, I think it might contain useful information.

Hope this helps.