nxhack / openwrt-node-packages

OpenWrt Project Node.js packages. v18.x TLS and v20.x LTS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Please add node-argon2

kele6ra opened this issue · comments

Hello, can you add node-argon2 ?

@nxhack Sorry, I am new with openWRT.A
rgon2 needs pre-compiled binary. I can't find it, maybe I look for it in a wrong place. When I wrote npm i it tries to download argon2-v0.27.2-napi-v3-linux-arm-musl.tar.gz (but can't find it and then tries to build it with mode-gyp).
I use openWRT 19.07.
Or maybe I should add this library to openwrt myself?

You will need to build the package for your target machine by yourself.

Please take a look at the OpenWrt documentations.

https://openwrt.org/docs/guide-user/additional-software/imagebuilder
https://forum.openwrt.org/t/custom-build-package-inside-image-builder-image/40350

I found that pre-build binary is made with the help of the node-gyp during the openWRT building. And I can find it in /usr/lib/node/argon2/lib. But nodeJS tries to install it localy when I make 'npm i' instead of using global version form /usr/lib.

I copy argon2.node binary from lib dir to local node_modules and all is working now. I think it is nodeJS issue, not argon2 library. I had the same problem with sqlite3.

The node-related packages in this repository are designed to be installed in a "global" installation.

If you are using it in a "local" installation, then you are correct to do as you did.

Incidentally, OpenWrt is designed as a router OS optimized for underpowered embedded MPUs, unlike regular server OSs.

Because of this design philosophy, various services can be run under the so-called "Run As Root" policy.
Or, they can be run with the privileges of a user dedicated to that service.

It is not a problem in the design philosophy of OpenWrt that node modules also use packages for global installation.

I compiled openWRT rootfs with inckuding sqlite3 and argon2, after I tried to use these modules as "global" installed and node can't recognize them as globally installed packages.
They become to work only after merging global and local version.

Hmmm... In my environment, I can use modules on "global" without any problem.

If you can figure out what's causing your problem, I'd appreciate it.

Hmmm... In my environment, I can use modules on "global" without any problem.

If you can figure out what's causing your problem, I'd appreciate it.

Should I install packet globally after OpenWRT start or it should works out of the box? I try to install packets from package.json and it tries to install packet locally and build sqlite3 lib instead of using it from /usr/lib/node/sqlite3.

I want to make sure that you have set your "NODE_PATH". If you do, what is the value?

I want to make sure that you have set your "NODE_PATH". If you do, what is the value?

Thank you, you are right, I have started application without "NODE_PATH". I thought that it should be set out-of-the-box in the global PATH.