Description
When running npx angular-cli-ghpages in a non-Angular project (package.json in working directory), the command fails with:
❌ An error occurred when trying to deploy:
The "path" argument must be of type string or an instance of Buffer or URL. Received undefined
Reproduction
- Create a simple repo with just a
dist/ folder containing files to deploy
- Run:
npx angular-cli-ghpages --dir=dist --branch=gh-pages
- Error occurs
Workaround
Installing the package first fixes the issue:
npm install angular-cli-ghpages
npx angular-cli-ghpages --dir=dist --branch=gh-pages
Context
This was discovered while setting up a CI workflow for a non-Angular project that uses angular-cli-ghpages to deploy static content.
Environment
- angular-cli-ghpages: 3.0.2
- Node.js: 22.x
- Running in GitHub Actions