I have setup a yml file for CI but the job fails.
See the last few lines at the end of the build step below:
$ npm install netlify-cli -g
/bin/sh: eval: line 146: npm: not found
Cleaning up project directory and file based variables
00:01
ERROR: Job failed: exit code 127
When looking at the build failure, it seems the issue is that it canβt install node.js/npm after it installed Plenit at line 12.
- npm install netlify-cli -g
Firstly this install needed? I did install the Netlify cli globally on my PC in the set up process.
If it is required, then could we use an image that includes Node.js and npm such as image: node:latest
Hi @jamestagal, Iβm confused, what is the Netlify build step? Is a build actually taking place on Netlify? There shouldnβt be any build happening directly on Netlify, it should all happen in GitLab CI instead as discussed here: Netlify backend for CMS Β· Issue #262 Β· plentico/plenti Β· GitHub. Does that make sense? Thanks!
Hi Jim. Yes good question.
When I went through the setup of linking Netlify to the project I do remember being asked questions like:
? Your build command (hugo build/yarn run build/etc): ./plenti build
? Directory to deploy (blank for current dir): public
? No netlify.toml detected. Would you like to create one with these build settings? Yes
This might be the problem.
I have stoppped the builds in Netlify now. Below is a screenshot of the build setttings. Should I delete or clear out the setting here entirely?
I think as long as the builds are βstoppedβ you should be fine: Stop or activate builds | Netlify Docs. I mean you probably could technically even leave them on, theyβll just fail every time a change is made. Do you see the builds from GitLab appearing in Netlify?
When looking at the url. https://inspiredfencing.netlify.app/ css or something is missing and if you click on one of the siteβs pages it appends that route to the url like https://inspiredfencing.netlify.app/inspiredfencing/about
So possibly there is a issue with the folder structure of the build? It is probably the baseurl causing the issue. Should I remove it from the settings in Netlify and or from my projectβs plenti.json file? See screenshot from pervious post for Netlify build settings.
Yes. though something is broken.
And as I said above clicking on one of the routes appends that to the url. See screeenshot below. https://inspiredfencing.netlify.app/
You want it to be https://inspiredfencing.netlify.app/about not https://inspiredfencing.netlify.app/inspiredfencing/about right? Just remove all the baseurl stuff:
settings in plenti.json
{env.baseurl} in layouts/global/head.svelte (or wherever youβre defining your html <head>
ok
after removing the baseurl from the project, the GitLab CI fails.
$ ./plenti build
Total build took 3.572814098s
$ npm install netlify-cli -g
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
added 1280 packages in 17s
210 packages are looking for funding
run `npm fund` for details
$ netlify deploy --dir ./public --site $NETLIFY_SITE_ID --auth $NETLIFY_AUTH_TOKEN --prod --timeout=600 --message "Deployed on $(date)"
(node:132) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
βΊ Error: Site not found. Please rerun "netlify link"
Cleaning up project directory and file based variables
00:00
ERROR: Job failed: exit code 1
I see the ```Please rerun βnetlify linkβ so I did that locally:
netlify link
(node:77905) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
Site already linked to "inspiredfencing"
Admin url: https://app.netlify.com/sites/inspiredfencing