Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Message during Vercel deployment #73

Closed
brycewray opened this issue Sep 18, 2022 · 2 comments
Closed

Message during Vercel deployment #73

brycewray opened this issue Sep 18, 2022 · 2 comments

Comments

@brycewray
Copy link

During a test today, I was mirroring my Cloudflare Pages site on Vercel. I followed the build command (a shell script, so as to install the Embedded Dart Sass binary in the PATH) with && npx pagefind -y --source "public". The rest of the build went normally, but the attempt to run Pagefind didn’t work. This is the relevant segment from the deployment log:

08:58:38.896 | npm WARN exec The following package was not found and will be installed: pagefind
08:58:40.547 | error: Found argument '-y' which wasn't expected, or isn't valid in this context
08:58:40.548 |  
08:58:40.548 | If you tried to supply `-y` as a value rather than a flag, use `-- -y`
08:58:40.548 |  
08:58:40.548 | USAGE:
08:58:40.548 | pagefind_extended [OPTIONS]
08:58:40.548 |  
08:58:40.548 | For more information try --help

By comparison: my normal deployment process to Cloudflare Pages involves a GitHub Action which first installs/builds Hugo and then runs Pagefind with npx -y pagefind --source "public" — so I’m not sure why this didn’t work with Vercel, but thought the log excerpt might be of value.

@bglw
Copy link
Contributor

bglw commented Sep 19, 2022

Hi @brycewray — this looks like a npm version < 7 🙂 They added the manual yes prompt (and thus the -y) flag in v7. (I should clarify the npm version in the docs)

Quickest solution is to change to npm_config_yes=true npx pagefind --source "public" which is slightly more verbose but will set the environment variable for v7 and be silently ignored for v6 🙂

@brycewray
Copy link
Author

Hi @brycewray — this looks like a npm version < 7 🙂 They added the manual yes prompt (and thus the -y) flag in v7. (I should clarify the npm version in the docs)

Quickest solution is to change to npm_config_yes=true npx pagefind --source "public" which is slightly more verbose but will set the environment variable for v7 and be silently ignored for v6 🙂

@bglw Thanks for that info!

@bglw bglw closed this as completed Sep 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants