!NhAsaYbbgmzHtXTPQJ:funklause.de

Nix NodeJS

154 Members
48 Servers

Load older messages


SenderMessageTime
29 Apr 2024
@c0ba1t:matrix.orgCobaltOtoh you might likely lack some ca certificates. However, how to fix that depends on where (env, phase) you exactly call `npm ci`.22:16:38
@c0ba1t:matrix.orgCobaltIf possible, please share your derivation to make it easier for us to try to help you.22:17:41
@matejam:matrix.orgmatejamI'm calling it in the build phase. Here's my derivation: https://github.com/MatejaMaric/yota-laravel/blob/8216bcd18ac36805a0d1dc1eb08ebc7fa05f6bfe/derivation.nix22:19:23
@c0ba1t:matrix.orgCobaltI don't think you have internet access in the build phase. That should make an `npm ci` call unlikely to work and would also explain why no ca certificates are present.22:21:19
@lily:lily.flowersLily FosternpmConfigHook does the npm ci for you22:22:14
@lily:lily.flowersLily Fosteroh you're not using buildNpmPackage. yeah you'll want something like that22:22:57
@matejam:matrix.orgmatejam I quite sure fixed-output (outputHash ) of my derivation solves that problem. In the derivation code you can see that I'm calling composer install which also requires internet access. 22:23:24
@samasaur:matrix.orgsamasaur If you're in a fixed-output derivation, you have internet access. I think you need to add cacert to nativeBuildInputs 22:23:54
@matejam:matrix.orgmatejam

oh you're not using buildNpmPackage. yeah you'll want something like that
I'm not using buildNpmPackage because I'm also calling php's composer and I don't know how to combine different builders...

22:24:45
@matejam:matrix.orgmatejam *

oh you're not using buildNpmPackage. yeah you'll want something like that

I'm not using buildNpmPackage because I'm also calling php's composer and I don't know how to combine different builders...

22:24:55
@lily:lily.flowersLily Foster
In reply to @matejam:matrix.org

oh you're not using buildNpmPackage. yeah you'll want something like that
I'm not using buildNpmPackage because I'm also calling php's composer and I don't know how to combine different builders...

you can do a postBuild script, or you can mix and match build hooks (idk how to deal with composer)
22:25:26
@lily:lily.flowersLily Foster(but you don't have to use either if you don't want to (assuming FOD unreproducibility isn't a problem for what you're doing))22:26:20
@lily:lily.flowersLily Foster
In reply to @samasaur:matrix.org
If you're in a fixed-output derivation, you have internet access. I think you need to add cacert to nativeBuildInputs
(and yes, this is probably the immediate cause of the error)
22:26:36
@matejam:matrix.orgmatejam
In reply to @samasaur:matrix.org
If you're in a fixed-output derivation, you have internet access. I think you need to add cacert to nativeBuildInputs
That does something, now I have a different error message 😄
EACCES: permission denied, mkdir '/homeless-shelter'
22:27:03
@lily:lily.flowersLily Foster
In reply to @matejam:matrix.org
That does something, now I have a different error message 😄
EACCES: permission denied, mkdir '/homeless-shelter'
yeahh it's gonna be a lot of things like that which the npm hooks already handle (there's, uh, a lot of edge cases)
22:27:44
@samasaur:matrix.orgsamasaurhttps://github.com/NixOS/nix/issues/670#issuecomment-121170012722:28:33
@samasaur:matrix.orgsamasaurlooks like this linked comment should solve your issue22:28:42
@samasaur:matrix.orgsamasaur at the start of buildPhase, run export HOME=$(pwd) 22:29:07
@samasaur:matrix.orgsamasaurbut lily is correct that we're really re-solving problems that the npm hooks have already solved22:29:46
@matejam:matrix.orgmatejam

but lily is correct that we're really re-solving problems that the npm hooks have already solved
Yeah, sadly that seems to be the case... After adding export HOME=$(pwd) I have a illegal path references in fixed-output derivation error.
I'll try using hooks tomorrow or some other day. If somebody already has an example of a packaged Laravel application feel free to send it to me. It's a bit convoluted since it mixes php and nodejs (Laravel Mix)...

22:34:36
@matejam:matrix.orgmatejam *

but lily is correct that we're really re-solving problems that the npm hooks have already solved

Yeah, sadly that seems to be the case... After adding export HOME=$(pwd) I have a illegal path references in fixed-output derivation error.
I'll try using hooks tomorrow or some other day. If somebody already has an example of a packaged Laravel application feel free to send it to me. It's a bit convoluted since it mixes php and nodejs (Laravel Mix)...

22:35:02
30 Apr 2024
@dominic_:matrix.org@dominic_:matrix.org left the room.20:07:37
@matejam:matrix.orgmatejam So, I made a new derivation that tries to mix buildComposerProject with fetchNpmDeps and npmHooks. Here's the link: https://github.com/MatejaMaric/yota-laravel/blob/7c2879793e752efbb92a1a419e77a64cffaf1a59/derivation.nix
It returns the error /nix/store/2wd77cc3g2r9iqb7iwlgd881zvh6f576-npm-config-hook/nix-support/setup-hook: line 84: npm: command not found.
20:31:18
@lily:lily.flowersLily Foster
In reply to @matejam:matrix.org
So, I made a new derivation that tries to mix buildComposerProject with fetchNpmDeps and npmHooks. Here's the link: https://github.com/MatejaMaric/yota-laravel/blob/7c2879793e752efbb92a1a419e77a64cffaf1a59/derivation.nix
It returns the error /nix/store/2wd77cc3g2r9iqb7iwlgd881zvh6f576-npm-config-hook/nix-support/setup-hook: line 84: npm: command not found.
you need nodejs in nativeBuildInputs
20:31:43
@lily:lily.flowersLily Foster you may also optionally need nodejs.python in nativeBuildInputs and nodejs in buildInputs if it has c++ libs 20:32:43
@lily:lily.flowersLily Foster and ++ lib.optionals stdenv.isDarwin [ darwin.cctools ] on nativeBuildInputs if it has c++ libs too, for darwin 20:33:06
@matejam:matrix.orgmatejamI saw that fetchNpmDeps is able to automatically use nodejs_18. Should I also just specify nodejs_18 or is there some mechanism to automatically determine the version?20:34:04
@lily:lily.flowersLily Fosterdo you need nodejs_18?20:34:49
@lily:lily.flowersLily Foster(fetcher shouldn't actually even need nodejs at all 🤔)20:35:16
@matejam:matrix.orgmatejamMaybe I'm wrong about nodejs_18, but I'm quite sure I saw it in the logs at some point. Anyway, in my previous fixed-point derivation I had to update my package-lock.json and with fetchNpmDeps I didn't have to do that which I really like 😄20:37:20

Show newer messages


Back to Room ListRoom Version: 6