简体   繁体   English

如何在 Google Cloud Platform 上的 Node.js 服务器上运行 Argon2?

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

I'm curently building a web app on Google App Engine Standard env.我目前正在 Google App Engine 标准环境中构建 web 应用程序。 using Node.js 10.16.3.使用 Node.js 10.16.3。 I would like to use Argon2 package .我想使用Argon2 package Unfortunately, I can't figure out how to install it locally on Windows7 and have no idea how on gcloud either.不幸的是,我不知道如何在 Windows7 上本地安装它,也不知道如何在 gcloud 上安装它。

It is said on the package page that:在 package 页面上说:

"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." “安装之前:在继续安装之前,您必须进行 node-gyp 全局安装,以及 GCC >= 5 / Clang >= 3.3。在 ZAEA23489CE3AA9B640156EBB28E0CDA 上,您必须在 Visual Studio222228E0CDA 下编译。”

I've installed node-gyp globally npm install -g node-gyp as well as Python lastest version which is required.我已经在全球范围内安装了 node- npm install -g node-gyp gyp 以及 Python 所需的最新版本。 I also installed GCC and then used npm install argon2 to install the package where my project is.我还安装了GCC ,然后使用npm install argon2 argon2 在我的项目所在的位置安装 package。 I'm not sure to understand the Visual Studio part.我不确定是否理解 Visual Studio 部分。

When trying to run the serveur with npm start , I get this error:尝试使用npm start运行服务器时,出现此错误:

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! myproject@0.0.1 start: `node www/server/server.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the myproject@0.0.1 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 node-gyp也无法识别

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?我发现了以下关于在 GAE 标准中实现库的功能请求,这也很有趣,你可以尝试用 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.与 flex 一样,您有可自定义的运行时,它可能允许您这样做。

Have a look at this other thread as well, I think it might contain useful information.也看看这个其他线程,我认为它可能包含有用的信息。

Hope this helps.希望这可以帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM