0

I'm trying to deploy my site to my github pages, but when I run npm run deploy it keeps giving this error:

**Error: ENOENT: no such file or directory, stat 'C:\Users\Wordsoft Ent\OneDrive\Desktop\Jewellry website\jewellry\build'
    at Object.statSync (node:fs:1658:25)
    at Object.statSync (C:\Users\Wordsoft Ent\OneDrive\Desktop\Jewellry website\jewellry\node_modules\graceful-fs\polyfills.js:319:16)
    at Object.publish (C:\Users\Wordsoft Ent\OneDrive\Desktop\Jewellry website\jewellry\node_modules\gh-pages\lib\index.js:90:13)
    at C:\Users\Wordsoft Ent\OneDrive\Desktop\Jewellry website\jewellry\node_modules\gh-pages\bin\gh-pages.js:12:13
    at new Promise (<anonymous>)
    at publish (C:\Users\Wordsoft Ent\OneDrive\Desktop\Jewellry website\jewellry\node_modules\gh-pages\bin\gh-pages.js:10:10) 
    at C:\Users\Wordsoft Ent\OneDrive\Desktop\Jewellry website\jewellry\node_modules\gh-pages\bin\gh-pages.js:140:12**

I have installed gh-pages. I have been trying this for days now. I'm running a vite-react app and tried deploying it.

3
  • Use the name of a file that does exist? The error is telling you exactly what is going wrong.
    – Pointy
    Commented Jul 4 at 12:03
  • Error message tells you, that there is no "build" (file or directory). Do you actually have this directory on your end? Does Vite generates this "build" directory? Or does Vite generates default "dist" one? Have you tried to search for similar errors in gh-pages repo? "deploy": "gh-pages -d dist". Commented Jul 4 at 12:13
  • It has a dist folder (I’m using Vite react) so instead of build. It will be dist. That’s why I’m confused Commented Jul 6 at 12:10

1 Answer 1

1

If you have the gh-pages installed on your project

npm install gh-pages --save-dev

then you should look out for a dist folder not a build folder as vite uses dist

so your package.json file should look very much like this:

package.json

I added the predeploy just to ensure that my project is built before deploying

1
  • Yes it has a dist folder. That’s why I’m confused as to why it is giving me this error Commented Jul 6 at 12:09

Not the answer you're looking for? Browse other questions tagged or ask your own question.