question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

EPERM error when running unit tests locally

See original GitHub issue

When some of us are running unit tests locally, we get an EPERM error caused by the jest-stare reporter

image

Error occurs in fs functions mkdirsSync and mkDirSyncimage const dirs is set to an array: ['C:', 'Users', 'theUser', ...] …and then on line 35 mkDirSync is called with C:/ as the argument, somehow passes the test on line 26, and fs tries to make directory C:/ …and then we get the EPERM error shown above P:

The error does not occur on the following unit tests: extension, DatasetTree, ZoweJobNode, USSTree

But all subsequent tests have the error.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:15 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
ghostcommented, Apr 22, 2020

The problem went away for me when I modified the arguments passed to Jest in .vscode/launch.json to be identical to the arguments used in npm run test:

"args": [
    ".*__tests__.*\\.unit\\.test\\.ts",
    "--coverage"
],
1reaction
CForrest97commented, Apr 22, 2020

I am also experiencing this issue but have noticed that running npm t works fine. So this must be something to do with VSCode’s debugger

Read more comments on GitHub >

github_iconTop Results From Across the Web

npm ERR! Error: EPERM: operation not permitted, rename
I got it working when tried npm install with a force option to fetch remote resources even if a local copy exists on...
Read more >
Untitled
Keystone uses Jest for unit tests and Cypress for end-to-end tests. All tests can be run locally and on CircleCI. Unit Tests. To...
Read more >
Error: EPERM: operation not permit… | Apple Developer Forums
I am installing packages for NODEJS/NPM and am receiving the following error, which, ... /usr/local/lib/node_modules/npm/lib/utils/error-handler.js:205.
Read more >
Troubleshooting AWS IoT Greengrass
Search the following symptoms and errors to find information to help ... Error: Runtime failed to start: unable to start workers: container test...
Read more >
[FIXED] Discord Fatal Javascript Error - 7 Possible Methods
There are various errors that you can face while using the Discord ... The user must clear Discord Local data and Discord app...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found