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.

TypeError: _gracefulFs(...).realpathSync.native is not a function

See original GitHub issue

Hi, I got this weird error, am I missing something ?

🐛 Bug Report

When i try to run jest from the cli i got this error. Here is the complete traceback:

TypeError: _gracefulFs(...).realpathSync.native is not a function
    at tryRealpath (C:\Users\malau\Documents\ProjetJS\MOPJs\node_modules\jest-config\node_modules\jest-util\build\tryRealpath.js:26:39)
    at getCacheDirectory (C:\Users\malau\Documents\ProjetJS\MOPJs\node_modules\jest-config\build\getCacheDirectory.js:89:33)
    at Object.<anonymous> (C:\Users\malau\Documents\ProjetJS\MOPJs\node_modules\jest-config\build\Defaults.js:39:50)
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Module.require (module.js:597:17)
    at require (internal/module.js:11:18)

To Reproduce

Steps to reproduce the behavior: npm install --save-dev jest jest-cli; npx jest --init or .\node_modules\.bin\jest --init Even just npx jest fail with the same error.

Link to repl or repo (highly encouraged)

My Project

envinfo

npx: installed 1 in 2.519s

  System:
    OS: Windows 10 10.0.18362
    CPU: (4) x64 Intel(R) Core(TM) i5-6300HQ CPU @ 2.30GHz
  Binaries:
    Node: 8.12.0 - C:\Program Files\nodejs\node.EXE
    npm: 6.4.1 - C:\Program Files\nodejs\npm.CMD
  npmPackages:
    jest: ^26.0.1 => 26.0.1

EDIT: With the latest version of node (14.2.0) it works without any issues.

Thank you in advance for your help !

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:8
  • Comments:25

github_iconTop GitHub Comments

24reactions
SimenBcommented, May 10, 2020

We do not support node 8, you need to upgrade to node 10 or keep using Jest 25 which supports node 8

9reactions
SimenBcommented, May 15, 2020

Can we please drop this native junk

What a wonderfully productive way to ensure you get help with your issue

use basic standard library functions?

This is part of Node.js core

https://nodejs.org/api/fs.html#fs_fs_realpathsync_native_path_options

Read more comments on GitHub >

github_iconTop Results From Across the Web

graceful-fs - npm
graceful-fs. graceful-fs functions as a drop-in replacement for the fs module, making various improvements.
Read more >
How to resolve fs.existsSync is not a function - node.js
I was facing the same Error like TypeError: fs.existsSync is not a function. enter image description here. So, I figured out that one...
Read more >
TypeError: _gracefulFs(...).realpathSync.native is not a function
执行jest的时候报错:TypeError: _gracefulFs(...).realpathSync.native is not a function解决方案:jest-cli@26.x.x 不支持node8, 使用jest-cli@25.
Read more >
fs-extra | Yarn - Package Manager
fs-extra adds file system methods that aren't included in the native fs module and adds promise ... It also uses graceful-fs to prevent...
Read more >
How I fixed a "cb.apply is not a function" error while using ...
/usr/local/lib/node_modules/gitbook-cli/node_modules/npm/node_modules/graceful-fs/polyfills.js:287 if (cb) cb.apply(this, arguments) ^ TypeError: cb.apply ...
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