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

Error: expected <NPM script name that starts server> <url or port> <NPM script name that runs tests> #26

Closed
GiancarlosIO opened this issue Mar 18, 2022 · 4 comments

Comments

@GiancarlosIO
Copy link

GiancarlosIO commented Mar 18, 2022

I'm getting the following error when running npm run validate

Steps to reproduce:

  1. run npx create-remix --template remix-run/grunge-stack
  2. run cd <your-app-name>
  3. run npm run validate

Extra info:

  • SO: windows 10
  • Node version: 14.18.1
  • npm version: 6.14.1

Also, I noticed this warning in the installation step:
npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@2. I'll try to do my best with it!
(which is expected because I have npm v6)

Looks like the error doesn't block the development server so I can live with it but I thought it would be good to report it so you guys can be aware of it.

Error: expected <NPM script name that starts server> <url or port> <NPM script name that runs tests>
example: start-test start 8080 test
see https://github.com/bahmutov/start-server-and-test#use

    at lazyAssLogic (D:\frontend-projects\experiments\my-remix-app\node_modules\lazy-ass\index.js:110:14)
    at lazyAss (D:\frontend-projects\experiments\my-remix-app\node_modules\lazy-ass\index.js:115:28)
    at Object.getArguments (D:\frontend-projects\experiments\my-remix-app\node_modules\start-server-and-test\src\utils.js:91:5)
    at Object.<anonymous> (D:\frontend-projects\experiments\my-remix-app\node_modules\start-server-and-test\src\bin\start.js:10:22)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:12)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
    at internal/main/run_main_module.js:17:47
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! my-remix-app-87b1@ test:e2e:run: `cross-env PORT=8811 start-server-and-test dev http://localhost:8811 'cypress run'`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the my-remix-app-87b1@ test:e2e:run script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
@kentcdodds
Copy link
Member

Can you provide reproduction steps and/or a github repo where you experience this problem? I just tried and got:

npx create-remix@latest --template remix-run/grunge-stack my-app
💿 Welcome to Remix! Let's get you set up with a new project.

? Do you want me to run `npm install`? Yes
? Do you want to run the build/tests/etc to verify things are setup properly? Yes

And this worked as expected for me.

@GiancarlosIO
Copy link
Author

@kentcdodds hi
I have updated the issue with the reproduction steps and also I have added extra info about my SO.
I think that maybe the error is related to windows 10 or npm v6

Thanks!

@mcansh
Copy link
Contributor

mcansh commented Jun 20, 2022

i think for full windows support, we might need to put the script names in quotes, @GiancarlosIO can you try updating the test:e2e:run script to the following?

- cross-env PORT=3000 start-server-and-test dev http://localhost:3000 \"npx cypress run\"
+ cross-env PORT=3000 start-server-and-test \"dev\" http://localhost:3000 \"npx cypress run\"

@mcansh mcansh added the needs-response We need a response from the original author about the issue label Jun 20, 2022
@machour
Copy link
Collaborator

machour commented Jul 11, 2022

Closing this issue as no response was provided.
Feel free to re-open it if it's still a problem.

@machour machour closed this as not planned Won't fix, can't repro, duplicate, stale Jul 11, 2022
@MichaelDeBoey MichaelDeBoey removed the needs-response We need a response from the original author about the issue label Nov 20, 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

5 participants