`fastify start` command is throwing `missing file parameter` error on Windows
See original GitHub issuePrerequisites
- I have written a descriptive issue title
- I have searched existing issues to ensure it has not already been reported
Fastify version
^3.15.1
Node.js version
15.14.0
Operating system
Windows
Operating system version (i.e. 20.04, 11.3, 10)
2004
Description
I just joined a project that uses fastify as their backend framework of choice and we have the following npm script to launch the server during development:
fastify start -w server/fastify.js --options --ignore-watch='out.csv node_modules ui .nyc_output' | pino-pretty
I managed to run this on Windows Sub-system for Linux (WSL), but not on the native powershell. Whenever I try to run this on powershell I get the following error:
Missing the required file parameter
Usage: fastify start [opts] <file> [--] [<plugin-options>]
But from what I can tell, we are specifying the file parameter as server/fastify.js
in the script.
Any idea why this fails on Windows, but works fine on WSL? Both my Windows and WSL have the same versions of Node and npm and are running on the same laptop.
It also works fine on my colleagues Macs as well, in case that helps diagnose this.
This is my first fastify project, so I’m not entirely sure what to be looking for to self-diagnose. I’d be happy to provide any further details if needed.
Steps to Reproduce
I think it should be easy enough to reproduce with any simple fastify project, with the file to launch the server in a server/ folder, rather than the root.
Expected Behavior
I generally expect it work on Windows as well, when it works on Linux and Mac.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
@UmarGhouse replace single quotes with double quotes. If an npm script, escape them with backslashes, e.g.
Thanks @simoneb ! It works when I use double quotes instead of single ones (escaped with backslashes as shown). Tested the same on WSL and it works there as well! Just the bcrypt error left, but I think I can solve that by re-installing my packages.
So, I think we can close this issue 🙂. Thanks again!