Typescript example seems to be broken

Please search for similar issues before creating a ticket.
All fields below are required.

Description

I was trying to figure out how to do typescript test coverage, so I used codecov typescript example. Unfortunately, “out of the box” it does not work (I am on windows machine). When I try to run npm run test I get this output:

> example-typescript@1.0.0 pretest
> tsc -p .


> example-typescript@1.0.0 test
> nyc mocha

internal/modules/cjs/loader.js:883
  throw err;
  ^

Error: Cannot find module 'd:\Nauka\typescript\codecov_test\example-typescript\node'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
    at Function.Module._load (internal/modules/cjs/loader.js:725:27)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
    at internal/main/run_main_module.js:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}
----------|----------|----------|----------|----------|-------------------|
File      |  % Stmts | % Branch |  % Funcs |  % Lines | Uncovered Line #s |
----------|----------|----------|----------|----------|-------------------|
All files |        0 |        0 |        0 |        0 |                   |
----------|----------|----------|----------|----------|-------------------|

Commit SHAs

Not applicable

Repository

CI/CD or Build URL

Please provide which CI/CD you are using or a link to the build where coverage is being uploaded.

Uploader

Not applicable

Codecov Output

Not applicable

Expected Results

The code coverage to be 100% & no errors.

Actual Results

I get error

internal/modules/cjs/loader.js:883
  throw err;
  ^

Error: Cannot find module 'd:\Nauka\typescript\codecov_test\example-typescript\node'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
    at Function.Module._load (internal/modules/cjs/loader.js:725:27)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
    at internal/main/run_main_module.js:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

Additional Information

Not applicable

Apparently updating npm modules solved the issue.

1 Like