this is MERN with Vite project, Mac
node -v 20.15.0
npm -v 10.8.1
when I used npm run deploy, the error shows :
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined at Object.join (node:path:1175:7) at getCacheDir (/Users/tzuhuangyen/Desktop/MERN-PetsLove/client/node_modules/gh-pages/lib/index.js:24:15) at /Users/tzuhuangyen/Desktop/MERN-PetsLove/client/node_modules/gh-pages/lib/index.js:127:23
Describe what you tried:
- It did not have “React-scripts” this line in my package.json, and I saw someone suggest on stack overflow : added “React-scripts” in the package.json and update to lastest vision but it’s not working for me.
- Reinstall the gh-pages package:
- Update to the latest version of gh-pages:
- Clearing npm using npm cache clean –force
- Clean install using npm clean-install
- I triedd to modified this file(/Users/tzuhuangyen/Desktop/MERN-PetsLove/client/node_modules/gh-pages/lib/index.js:24:15) but i can not save it.
Yen is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.