-
Link to reproduction. To ReproduceI am utilizing Windows 11 as my operating system. Upon executing the command PS C:\Users\kavem\work> npx create-payload-app
Welcome to Payload. Let's create a project!
√ Project name? ... p1
√ Choose project template » website
√ Enter MongoDB connection ... mongodb://localhost:32768/p1
Creating project in C:\Users\kavem\work\p1
DegitError: could not find commit hash for HEAD
at Degit._cloneWithTar (C:\Users\kavem\AppData\Local\npm-cache\_npx\2238e51406dcebe9\node_modules\degit\dist\index-688c5d50.js:14258:10)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Degit.clone (C:\Users\kavem\AppData\Local\npm-cache\_npx\2238e51406dcebe9\node_modules\degit\dist\index-688c5d50.js:14096:4) {
code: 'MISSING_REF',
ref: 'HEAD'
}
PS C:\Users\kavem\work> npx create-payload-app^C
PS C:\Users\kavem\work> remove-Item -Recurse -Force .\p1 Describe the BugDuring the process of executing the Expected BehaviorThe Payload Version1.14.0 Thank you for your attention to this matter, and I appreciate your support in resolving this issue. If you require any further information or assistance, please do not hesitate to reach out. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
I was able to run this without an issue. Can you try again to rule out that whatever it was hasn't been fixed from a change in one of the dependencies? If you still have trouble, what else can you tell me about your environment? Maybe it has to do with the version of Node or NPM? Thanks! |
Beta Was this translation helpful? Give feedback.
-
npm cache clean --force
npx create-payload-app
Trying `0.3.34`
Trying `npx create-react-app` as well, it fails too!PS C:\Users\kavem\work> npx create-react-app r1 Need to install the following packages: create-react-app@5.0.1 Ok to proceed? (y) y npm WARN deprecated tar@2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.Creating a new React app in C:\Users\kavem\work\r1. Installing packages. This might take a couple of minutes. added 1439 packages in 2m 241 packages are looking for funding Installing template dependencies using npm... added 69 packages, and changed 1 package in 15s 245 packages are looking for funding removed 1 package, and audited 1508 packages in 3s 245 packages are looking for funding 6 high severity vulnerabilities To address all issues (including breaking changes), run: Run Success! Created r1 at C:\Users\kavem\work\r1 npm start npm run build npm test npm run eject We suggest that you begin by typing: cd r1 Happy hacking! I cant run `git` in powershell, as it's directory is not in `PATH`, I added `C:\Program Files\Git\cmd` to `PATH`.
After fixing `PATH`, `create-react-app` work.PS C:\Users\kavem\work> npx create-react-app r2 Creating a new React app in C:\Users\kavem\work\r2. Installing packages. This might take a couple of minutes. added 1439 packages in 53s 241 packages are looking for funding Initialized a git repository. Installing template dependencies using npm... added 69 packages, and changed 1 package in 6s 245 packages are looking for funding removed 1 package, and audited 1508 packages in 3s 245 packages are looking for funding 6 high severity vulnerabilities To address all issues (including breaking changes), run: Run Created git commit. Success! Created r2 at C:\Users\kavem\work\r2 npm start npm run build npm test npm run eject Now `create-payload-app` works too.PS C:\Users\kavem\work> npx create-payload-app p5 Welcome to Payload. Let's create a project! √ Choose project template » website Creating project in C:\Users\kavem\work\p5 √ Dependencies installed
In summary, the issue was related to Git not being recognized due to the PATH environment variable. Once the PATH was corrected, the issues were resolved, and creating the Payload app was successful. ✅ Please let me know if you need any further assistance or clarification! 🫰 |
Beta Was this translation helpful? Give feedback.
-
Could be a cache issue, does this help at all? |
Beta Was this translation helpful? Give feedback.
-
I've converted this to a discussion so it can be found by others having the same problem. In summary if you are running create-payload-app and get the error: Make sure that git's cmd is included in your PATH. |
Beta Was this translation helpful? Give feedback.
npm cache clean --force
npx create-payload-app