Cloning Umbraco CMS contrib branch code and buildi...
# help-with-umbraco
n
Has anybody seen the following problem? Steps to reproduce: 1. Clone the Umbraco CMS contrib branch code. 2. Open the project in Visual Studio 2019. 3. Build it and it shows the following build error: Error NU1104 Unable to find project 'D:\git\repos\Umbraco-CMS\tools\Umbraco.Core\Umbraco.Core.csproj'. Check that the project reference is valid and that the project file exists. Umbraco.JsonSchema D:\git\repos\Umbraco-CMS\tools\Umbraco.JsonSchema\Umbraco.JsonSchema.csproj Expected: It should build without any issue. I tried the same thing last Saturday during the Hacktoberfest and all was good.
c
Hi Nurhak, can you confirm that the project is in fact where the csproj is trying to look for it?
n
I have just fixed the problem by deleting Umbraco.Core project reference in Umbraco.JsonSchema and adding it again. Thanks @User , have a great day! https://cdn.discordapp.com/attachments/1164125367506841690/1164128849769009172/image.png?ex=6542167a&is=652fa17a&hm=6b9c1efd38f4ba3d04f390b4e3fbc689a89f48c156f54e86f4ad13e1bbd026b6&
Just wrote a blog post about how to fix this problem. Hope it helps to somebody someday: https://www.nurhakkaya.com/2023/10/how-to-fix-umbraco-cms-build-error.html
c
Cool stuff Nurhak! Out of curiousity, does that change show up in git?
also, if you're interested in a shiny purple MVP badge on Discord, reach out to Seb!
o
Hey, is there anyone who can help me with this? Highly appreciate.
s
@Odd_Dev_404 first of all, what are you trying to do? You should not run Umbraco from source code. Umbraco is extremely extensible and can do whatever you need. Instead, install Umbraco as noted above and then extend it any way you want to. If you're actually trying to contribute code back to Umbraco: great! In that case, what did you try?
o
"If you're actually trying to contribute code back to Umbraco: great! " This is my case 🙂
s
Cool! Please make sure to follow the build steps: https://github.com/umbraco/Umbraco-CMS/blob/contrib/.github/BUILD.md
o
I actually tried this. But still got that error.
s
looks like npm is trying to run inside visual studio, make sure you're on the latest vs and that npm is installed globally on your machine. I recommend volta: https://docs.volta.sh/guide/getting-started After installing that,
volta install node
should do the trick, you might need to restart VS after that or your whole machine. So: 1. upgrade VS 2. install latest npm globally 3. reboot and then try again
o
I see. Thanks for this. I'll try and let you know soon 🙂
I tried all the steps, and still no luck I get some new errors now
Severity Code Description Project File Line Suppression State Error (active) ENOENT: no such file or directory, open 'D:\Coding Projects\Umbraco-CMS\src\Umbraco.Web.UI.Client\package.json' Umbraco.Cms.Targets D:\Coding Projects\Umbraco-CMS\src\Umbraco.Cms.Targets\npm error enoent Could not read package.json 1
Severity Code Description Project File Line Suppression State Error (active) MSB3073 The command "npm run generate:jsonschema -- --out "D:\Coding Projects\Umbraco-CMS\src\Umbraco.Cms.Targets\umbraco-package-schema.json" tsconfig.json UmbracoPackage" exited with code -4058. Umbraco.Cms.Targets D:\Coding Projects\Umbraco-CMS\src\Umbraco.Cms.Targets\Umbraco.Cms.Targets.csproj 65
volta installed
npm and node globally installed
s
What happens if you manually run
npm i && npm run build
in the
src\Umbraco.Web.UI.Client
directory
o
Let me try that as well
Got this
package.json file is not created inside the src\Umbraco.Web.UI.Client
s
I see you have a space in your path, that might be the problem "Coding Projects"
o
But I run the npm command after cd into the src\Umbraco.Web.UI.Client path
So won't be an issue right?
Because npm --version works in the path without any issues
s
Not sure, I think that's the problem with paths in general, try putting it in D:\Dev\Umbraco-CMS and see how it goes
o
Ok
Tried that and still no luck
s
o
package.json file is not there
only package.lock file is there
that's strange since this is a fresh clone from github
s
Go back to: https://github.com/umbraco/Umbraco-CMS/blob/contrib/.github/BUILD.md I bet you forgot the first steps with the submodule.
o
I tried this already before
It says "fatal: destination path 'D:/Coding Projects/Umbraco-CMS/src/Umbraco.Web.UI.Client' already exists and is not an empty directory."
But let me try this way
Deleting Umbraco.Web.UI.Client complete folder and then run git submodule related commands
It worked 🙂
So, I think something happens when cloning from github and submodule not updating correctly
I tried "git submodule update --init" instead of using "git submodule update"
Then it works without any issues and I didn't want to delete the directory as I tried for the initial solution
Can I update the build documentation(as my very first contrinution 😁 ) with this ideal command and hope that will helpful for people like me facing to this exact issue?
s
o
git version 2.32.0.windows.2
This is my git version
s
ah yes, please upgrade, that's very old! A lot of security problems have been fixed since then. Maybe start with updating the documentation to note that people should be using the latest version of git!
o
Ok, let me update the git version first and try it
If still fails and need to use git submodule update --init let's add that to the doc. Otherwise as you suggested let's add should be using the latest version of git
s
Strange, it worked for me! But let's go with that command then, seems fine!
o
Yes, you're correct! I updated the git version and "git submodule update" works without any issues Then I deleted the folder content and tried "git submodule update --init", and it also worked So "git submodule update --init" works with any of the git versions We can update either to use the latest git version as you suggested or updating the command to the other one
What's your idea?
s
Let's list the command that works for all the git clients, then we don't need to worry about it! 👍
o
Sure, then let me do my very first contribution 😄
Should I add this as an issue in Github first and then do the change and create a PR? Or straightaway can I create the PR? Sorry I didn't check the code contribution guide yet
s
It's a good check of the contribution guide: if you can follow it and it works then it's great, otherwise you might want to do some more edits 😉
o
Sure
I'll do that way
5 Views