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

Unable to run with serve npm package #293

Open
Sebosek opened this issue Jan 11, 2021 · 2 comments
Open

Unable to run with serve npm package #293

Sebosek opened this issue Jan 11, 2021 · 2 comments

Comments

@Sebosek
Copy link

Sebosek commented Jan 11, 2021

Hi,
with the following configuration, start-server-and-test isn't able to run (maybe even parse arguments).

  "scripts": {
    "dev": "cross-env NODE_ENV=development webpack",
    "build": "cross-env NODE_ENV=production webpack --env production",
    "serve": "webpack serve",
    "start": "serve -l 8080 ./public",
    "test": "jest",
    "coverage": "jest --coverage --coverageReporters=cobertura",
    "cypress": "cypress open",
    "lint": "tsc --noEmit && eslint src/**/*.{ts,tsx,js,jsx} --fix",
    "ci": "start-test 'yarn run start' 8080 './node_modules/.bin/cypress run'"
  },
  • version: 1.11.7, node: v14.15.1, yarn: 1.22.10
  • platform: Windows 10,
  • expected behaviour: Application is started and cypress runs tests.
  • actual behaviour: The following error is shown.
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 (C:\Projects\React Starter\node_modules\lazy-ass\index.js:110:14)
    at lazyAss (C:\Projects\React Starter\node_modules\lazy-ass\index.js:115:28)
    at Object.getArguments (C:\Projects\React Starter\node_modules\start-server-and-test\src\utils.js:51:5)
    at Object.<anonymous> (C:\Projects\React Starter\node_modules\start-server-and-test\src\bin\start.js:10:22)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
    at internal/main/run_main_module.js:17:47
error Command failed with exit code 1.
@snapwich
Copy link

snapwich commented Mar 2, 2021

I needed to change the single quotes to double quotes for this to work on my windows machine. (single quotes worked fine on OSX)

e.g.
"ci": "start-test \"yarn run start\" 8080 \"./node_modules/.bin/cypress run\""

@revelt
Copy link

revelt commented Aug 30, 2024

@Sebosek if switching to double quotes helped, please close this issue

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

3 participants