I have a public repo here that is a simple ExpressJS NodeJs project in TypeScript which uses Jest for unit tests.
When I run npx stryker run --fileLogLevel trace --logLevel debug
though I get this output and error:
16:23:03 (41154) INFO ConfigReader Using stryker.conf.js in the current working directory.
16:23:03 (41154) DEBUG ConfigReader Loading config stryker.conf.js
16:23:03 (41154) DEBUG PluginLoader Loading stryker-* from /Users/jim/Git-Projects/mtdd-typescript-nodejs-example/node_modules
16:23:03 (41154) DEBUG PluginLoader Expression stryker-* not resulted in plugins to load
16:23:03 (41154) DEBUG PluginLoader Loading plugins /Users/jim/Git-Projects/mtdd-typescript-nodejs-example/node_modules/stryker/src/reporters/index.js
16:23:03 (41154) DEBUG PluginLoader Loading plugins /Users/jim/Git-Projects/mtdd-typescript-nodejs-example/node_modules/stryker/src/mutators/index.js
16:23:03 (41154) DEBUG BroadcastReporter Broadcasting to reporters ["clear-text","progress"]
16:23:03 (41154) INFO InputFileResolver Found 3 of 11 file(s) to be mutated.
16:23:03 (41154) DEBUG InputFileResolver All input files: [
"/Users/jim/Git-Projects/mtdd-typescript-nodejs-example/jest.config.js",
"/Users/jim/Git-Projects/mtdd-typescript-nodejs-example/package-lock.json",
"/Users/jim/Git-Projects/mtdd-typescript-nodejs-example/package.json",
"/Users/jim/Git-Projects/mtdd-typescript-nodejs-example/src/app.ts",
"/Users/jim/Git-Projects/mtdd-typescript-nodejs-example/src/sum.test.ts",
"/Users/jim/Git-Projects/mtdd-typescript-nodejs-example/src/sum.ts",
"/Users/jim/Git-Projects/mtdd-typescript-nodejs-example/stryker.conf.js",
"/Users/jim/Git-Projects/mtdd-typescript-nodejs-example/tsconfig.json",
"/Users/jim/Git-Projects/mtdd-typescript-nodejs-example/.gitignore",
"/Users/jim/Git-Projects/mtdd-typescript-nodejs-example/LICENSE",
"/Users/jim/Git-Projects/mtdd-typescript-nodejs-example/README.md"
]
16:23:03 (41154) DEBUG InputFileResolver Files to mutate: [
"/Users/jim/Git-Projects/mtdd-typescript-nodejs-example/src/app.ts",
"/Users/jim/Git-Projects/mtdd-typescript-nodejs-example/src/sum.test.ts",
"/Users/jim/Git-Projects/mtdd-typescript-nodejs-example/src/sum.ts"
]
16:23:03 (41154) WARN TestFrameworkOrchestrator Missing config settings `testFramework`. Set `coverageAnalysis` option explicitly to "off" to ignore this warning.
16:23:03 (41154) ERROR StrykerCli an error occurred Exception [Error]: Could not inject "InitialTestExecutor". Inner error: Could not inject "TranspilerFacade". Inner error: Cannot load Transpiler plugin "typescript". In fact, no Transpiler plugins were loaded. Did you forget to install it?
at ClassProvider.injectClass (/Users/jim/Git-Projects/mtdd-typescript-nodejs-example/node_modules/typed-inject/src/InjectorImpl.js:35:19)
at ClassProvider.injectClass (/Users/jim/Git-Projects/mtdd-typescript-nodejs-example/node_modules/typed-inject/src/InjectorImpl.js:95:22)
at Stryker.<anonymous> (/Users/jim/Git-Projects/mtdd-typescript-nodejs-example/node_modules/stryker/src/Stryker.js:75:30)
at step (/Users/jim/Git-Projects/mtdd-typescript-nodejs-example/node_modules/tslib/tslib.js:133:27)
at Object.next (/Users/jim/Git-Projects/mtdd-typescript-nodejs-example/node_modules/tslib/tslib.js:114:57)
at fulfilled (/Users/jim/Git-Projects/mtdd-typescript-nodejs-example/node_modules/tslib/tslib.js:104:62) {
innerError: Exception [Error]: Could not inject "TranspilerFacade". Inner error: Cannot load Transpiler plugin "typescript". In fact, no Transpiler plugins were loaded. Did you forget to install it?
at ClassProvider.injectClass (/Users/jim/Git-Projects/mtdd-typescript-nodejs-example/node_modules/typed-inject/src/InjectorImpl.js:35:19)
at ClassProvider.injectClass (/Users/jim/Git-Projects/mtdd-typescript-nodejs-example/node_modules/typed-inject/src/InjectorImpl.js:95:22)
at ClassProvider.result (/Users/jim/Git-Projects/mtdd-typescript-nodejs-example/node_modules/typed-inject/src/InjectorImpl.js:173:21)
at ClassProvider.resolveInternal (/Users/jim/Git-Projects/mtdd-typescript-nodejs-example/node_modules/typed-inject/src/InjectorImpl.js:131:36)
at /Users/jim/Git-Projects/mtdd-typescript-nodejs-example/node_modules/typed-inject/src/InjectorImpl.js:56:33
at Array.map (<anonymous>)
at ClassProvider.resolveParametersToInject (/Users/jim/Git-Projects/mtdd-typescript-nodejs-example/node_modules/typed-inject/src/InjectorImpl.js:49:23)
at ClassProvider.injectClass (/Users/jim/Git-Projects/mtdd-typescript-nodejs-example/node_modules/typed-inject/src/InjectorImpl.js:31:31)
at ClassProvider.injectClass (/Users/jim/Git-Projects/mtdd-typescript-nodejs-example/node_modules/typed-inject/src/InjectorImpl.js:95:22)
at Stryker.<anonymous> (/Users/jim/Git-Projects/mtdd-typescript-nodejs-example/node_modules/stryker/src/Stryker.js:75:30) {
innerError: Error: Cannot load Transpiler plugin "typescript". In fact, no Transpiler plugins were loaded. Did you forget to install it?
at PluginLoader.resolve (/Users/jim/Git-Projects/mtdd-typescript-nodejs-example/node_modules/stryker/src/di/PluginLoader.js:40:19)
at PluginCreator.create (/Users/jim/Git-Projects/mtdd-typescript-nodejs-example/node_modules/stryker/src/di/PluginCreator.js:11:42)
at /Users/jim/Git-Projects/mtdd-typescript-nodejs-example/node_modules/stryker/src/transpiler/TranspilerFacade.js:17:103
at Array.map (<anonymous>)
at new TranspilerFacade (/Users/jim/Git-Projects/mtdd-typescript-nodejs-example/node_modules/stryker/src/transpiler/TranspilerFacade.js:17:14)
at ClassProvider.injectClass (/Users/jim/Git-Projects/mtdd-typescript-nodejs-example/node_modules/typed-inject/src/InjectorImpl.js:32:20)
at ClassProvider.injectClass (/Users/jim/Git-Projects/mtdd-typescript-nodejs-example/node_modules/typed-inject/src/InjectorImpl.js:95:22)
at ClassProvider.result (/Users/jim/Git-Projects/mtdd-typescript-nodejs-example/node_modules/typed-inject/src/InjectorImpl.js:173:21)
at ClassProvider.resolveInternal (/Users/jim/Git-Projects/mtdd-typescript-nodejs-example/node_modules/typed-inject/src/InjectorImpl.js:131:36)
at /Users/jim/Git-Projects/mtdd-typescript-nodejs-example/node_modules/typed-inject/src/InjectorImpl.js:56:33
}
}
I thought I should have all the necessary things installed already since I followed all the documentation and have these three striker dev dependencies installed in my package.json file:
{
"name": "mtdd-typescript-nodejs-example",
"version": "1.0.0",
"description": "from the live stream!",
"main": "index.js",
"scripts": {
"start": "node dist/app.js",
"build": "tsc",
"test": "jest",
"test:cov": "jest --coverage",
"mtdd": "stryker run"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"@types/express": "^4.17.17",
"express": "^4.18.2"
},
"devDependencies": {
"@stryker-mutator/typescript": "^4.0.0",
"@types/jest": "^29.5.3",
"jest": "^29.6.2",
"stryker": "^0.35.1",
"stryker-api": "^0.24.1",
"ts-jest": "^29.1.1",
"typescript": "^5.1.6"
}
}
Am I doing something wrong here? Anyone see how I can get stryker running properly in this project? Thanks!
PS. I am using node v18.17.0
You are using the
stryker
package which is deprecated. You want the@stryker-mutator/core
package instead. For the easiest setup I'd recommend removing thestryker
andstryker-api
packages, runningnpm install
, andnpx stryker init
. See the quickstart