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: Stryker Doesn't Run #4677

Open
JimLynchCodes opened this issue Dec 22, 2023 · 1 comment
Open

Error: Stryker Doesn't Run #4677

JimLynchCodes opened this issue Dec 22, 2023 · 1 comment
Labels
🐛 Bug Something isn't working

Comments

@JimLynchCodes
Copy link

installed:

npm i -D stryker-cli

run with:

npm run stryker -- run

Error:

angular14-project@0.0.0 stryker
stryker run

(node:52457) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.
(Use node --trace-warnings ... to show where the warning was created)
/Users/jim/Git-Projects/aoc-23-day-4-elf-scratchcards/Angular14Project/node_modules/.bin/stryker:2
import { StrykerCli } from '../dist/src/index.js';
^^^^^^

SyntaxError: Cannot use import statement outside a module
at internalCompileFunction (node:internal/vm:73:18)
at wrapSafe (node:internal/modules/cjs/loader:1178:20)
at Module._compile (node:internal/modules/cjs/loader:1220:27)
at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
at Module.load (node:internal/modules/cjs/loader:1119:32)
at Module._load (node:internal/modules/cjs/loader:960:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:23:47

Node.js v18.17.0

@JimLynchCodes JimLynchCodes added the 🐛 Bug Something isn't working label Dec 22, 2023
@nicojs
Copy link
Member

nicojs commented Jan 17, 2024

Hi Jim, you shouldn't install the stryker-cli locally. Please install stryker itself:

npm i -D @stryker-mutator/core

The core package comes with its own stryker binary, so npx stryker run (or npm run stryker -- run) should work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants