Search
Setup for Free
CD
Cloudflare Developers
•
3y ago
nikiv.dev
how can i update env of preview deployment via api?
how can i update env of preview deployment via api
?
Cloudflare Developers
Join
Welcome to the official Cloudflare Developers server. Here you can ask for help and stay updated with the latest news
83,498
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Similar Threads
Was this page helpful?
Yes
No
© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
N
nikiv.dev
OP
•
10/11/23, 9:25 AM
i want to setup preview deployments
N
nikiv.dev
OP
•
10/11/23, 9:25 AM
and on each branch created
, i want to setup preview deployment that will point to a certain API url
N
nikiv.dev
how can i update env of preview deployment via api?
E
Erisa
•
10/11/23, 9:35 AM
https://developers.cloudflare.com/api/operations/pages-project-update-project
would be the one
Cloudflare API Documentation
Interact with Cloudflare
's products and services via the Cloudflare API
E
Erisa
•
10/11/23, 9:35 AM
theres an example body on there
C
charl.dev
•
10/11/23, 9:44 AM
havnt followed up on this in a while
, is there a way to assign a subdirectory to a page
?
e
.g
. page1
-
> example
.com
/page1
?
Original message was deleted
C
Cyb3r-Jak3
•
10/11/23, 11:49 AM
Please don
’t point staff
.
C
Cyb3r-Jak3
•
10/11/23, 11:49 AM
Is your cname to your own pages project or a different one
?
C
Cyb3r-Jak3
•
10/11/23, 11:51 AM
If it
’s not on your Cloudflare account then you need to make it unproxied
.
C
Cyb3r-Jak3
•
10/11/23, 11:53 AM
Don
’t know
. It could be that something in the account you had the project pointed at changed
C
Catto
•
10/11/23, 6:56 PM
C
Catto
•
10/11/23, 6:56 PM
anyone know how to fix this error
?
C
Catto
•
10/11/23, 6:57 PM
when building deployment
E
Erisa
•
10/11/23, 6:58 PM
Run
npm install
npm install
locally and push the change
? Your dependencies are in an invalid state for a clean install
E
Erisa
Run `npm install` locally and push the change? Your dependencies are in an inval...
C
Catto
•
10/11/23, 6:59 PM
i did that
C
Catto
•
10/11/23, 6:59 PM
and then pushed changes to the repos
C
Catto
•
10/11/23, 6:59 PM
and it rebuilded it
, and it still says that error
C
Catto
•
10/11/23, 6:59 PM
(on vs code i did that
, the terminal
)
C
Catto
•
10/11/23, 7:13 PM
any clues
?
C
Catto
•
10/11/23, 7:14 PM
C
Catto
•
10/11/23, 7:14 PM
heres how it loosk on github
C
Catto
•
10/11/23, 7:18 PM
@Erisa
please erissa
, i came from github pages coz that didnt work for me
, and id like cloudflare pages to work
;
-
;
J
James
•
10/11/23, 7:23 PM
Can you paste a full build log
?
J
James
•
10/11/23, 7:23 PM
I am going to guess that you
're using a different node
/npm version locally compared to what is running in the Pages build image
.
C
Catto
•
10/11/23, 7:25 PM
C
Catto
•
10/11/23, 7:25 PM
well after adding this bit and re running npm install and ci
, i get this error instead now
C
Catto
•
10/11/23, 7:26 PM
C
Catto
•
10/11/23, 7:26 PM
to package
.json i added
J
James
Can you paste a full build log?
C
Catto
•
10/11/23, 8:15 PM
C
Catto
•
10/11/23, 8:15 PM
kay i created a new repos
C
Catto
•
10/11/23, 8:15 PM
and pasted in the project code
C
Catto
•
10/11/23, 8:16 PM
so now its basically fresh new start
C
Catto
•
10/11/23, 8:16 PM
and im getting this error
J
James
•
10/11/23, 8:16 PM
That looks like you don
't have a package
.json file
, and are trying to run
npm run build
npm run build
C
Catto
•
10/11/23, 8:16 PM
ok
C
Catto
•
10/11/23, 8:17 PM
i do tho
, but i did run it
, and it didnt add anything new
C
Catto
•
10/11/23, 8:17 PM
J
James
That looks like you don't have a package.json file, and are trying to run `npm r...
C
Catto
•
10/11/23, 8:18 PM
any ideas
?
J
James
•
10/11/23, 8:19 PM
Please provide a full reproduction repository
, pages config
, and build output
J
James
•
10/11/23, 8:19 PM
This would probably be better in a
pages-help
thread
C
Catto
•
10/11/23, 8:19 PM
well it did say this
C
Catto
•
10/11/23, 8:19 PM
now taht u mention the output
J
James
Please provide a full reproduction repository, pages config, and build output
C
Catto
•
10/11/23, 8:25 PM
omg
C
Catto
•
10/11/23, 8:25 PM
now its saying same thing
C
Catto
•
10/11/23, 8:25 PM
as last time
C
Catto
•
10/11/23, 8:25 PM
btw
(i fixed that other error coz my site was in a sub folder
)
C
Catto
•
10/11/23, 8:25 PM
so i added the path to it in the config
C
Catto
•
10/11/23, 8:25 PM
at cloudflare
M
Michał
•
10/11/23, 8:34 PM
Did you try updating the lockfile with npm install
?
C
Catto
•
10/11/23, 8:39 PM
https://community.cloudflare.com/t/i-cannot-deploy-my-website/536564/18
C
Catto
•
10/11/23, 8:39 PM
well i came across this solution
Next page
Similar Threads
Deployment via API
CD
Cloudflare Developers / pages-help
17mo ago
Deployment failed via API
CD
Cloudflare Developers / general-help
11mo ago
How to Update route of a specific worker via API
CD
Cloudflare Developers / general-help
7mo ago
Preview deployment domain
CD
Cloudflare Developers / workers-and-pages-help
4mo ago