Installing packages to a Cloudflare Pages enviornment

I'm setting up and Tauri and Svelte website on Cloudflare pages and I've run into a issue installing packages using apt as a root user. I'm getting The "no new privileges" flag is set, which prevents sudo from running as root.. Does Cloudflare Pages allow me installing packages like this?
18 Replies
Erisa
Erisa7mo ago
You cant install packages with apt in Pages build system, you don't have root access
LimesKey
LimesKeyOP7mo ago
Would you happen to know an alternative for installing these packages?
No description
LimesKey
LimesKeyOP7mo ago
I frequently also use Github Workflows and with that I'm able to use root and install packages, I know they're not the same though.
Erisa
Erisa7mo ago
Most of them should exist already but not all, do you get errors without those?
LimesKey
LimesKeyOP7mo ago
I do
Erisa
Erisa7mo ago
But like, no I don't really think there is a way.. you can always use a GitHub Action to deploy instead if Pages build system isn't working for your usecase
LimesKey
LimesKeyOP7mo ago
So I would build in Github Actions and then Cloudflare Pages would deploy that?
Erisa
Erisa7mo ago
GitHub
GitHub - cloudflare/pages-action
Contribute to cloudflare/pages-action development by creating an account on GitHub.
LimesKey
LimesKeyOP7mo ago
right, I think I've used that before actually Thanks for your help
Erisa
Erisa7mo ago
I've seen plenty of projects have success with it and the experience is not bad at all if youre already familiar with github actions the handling of branch aliases all just works automaticallly same as Pages builds if you dont specify branch anyway (then it infers from the current checkout)
LimesKey
LimesKeyOP7mo ago
I've already had a whole ordeal trying to get my build command on Cloudflare Pages to work, look how long it is now,
curl https://sh.rustup.rs -sSf | sh -s -- -y && . "$HOME/.cargo/env" && curl -fsSL https://get.pnpm.io/install.sh | sh -s -- -y && pnpm install && pnpm tauri build
curl https://sh.rustup.rs -sSf | sh -s -- -y && . "$HOME/.cargo/env" && curl -fsSL https://get.pnpm.io/install.sh | sh -s -- -y && pnpm install && pnpm tauri build
thanks
Erisa
Erisa7mo ago
pnpm should already be installed, not sure about rust
LimesKey
LimesKeyOP7mo ago
ah I think the issue was the pnpm version was too outdated
Erisa
Erisa7mo ago
you can set PNPM_VERSION to change it
LimesKey
LimesKeyOP7mo ago
good to know
Erisa
Erisa7mo ago
Cloudflare Docs
Language support and tools · Cloudflare Pages docs
Cloudflare Pages’ build environment has broad support for a variety of languages, such as Ruby, Node.js, Python, PHP, and Go.
LimesKey
LimesKeyOP7mo ago
I'm having a little trouble with the output directory,
No description
Want results from more Discord servers?
Add your server