Skip to content

node 12.18.3 fails with TypeError: cb.apply is not a function in graceful-fs #34529

Description

@marcelgsteiger

After upgrading my Raspberry Pi 4 today, my nodered app stopped operating. I get the error

TypeError: cb.apply is not a function
at ~/.node-red/node_modules/npm/node_modules/graceful-fs/polyfills.js:287:18
at FSReqCallback.oncomplete (fs.js:169:5)
nodered.service: Main process exited, code=exited, status=1/FAILURE
nodered.service: Failed with result 'exit-code'.

I then went back to 12.18.0 - which operates flawlessly, then to 12.18.2 with npm 6.14.5, this also works as expected.

npm list
/root
├─┬ @iekedemus/vulgar-fraction@1.0.0
│ └── greatest-common-divisor@1.0.0
├── graceful-fs@4.2.4
└── jsonata@1.8.3

Steps that caused the problem:

apt upgrade / apt update / npm update to current versions

Remarks:

I think this is a very recent issue but I do not know if I could reproduce it just by updating nodered. 25 packages were updated, including kernel and system firmware.

Regards
Marcel

Activity

  1. added
    duplicateIssues and PRs that are duplicates of other issues or PRs.
    npmIssues and PRs related to the npm client dependency or the npm registry.
    on Jul 27, 2020
  2. addaleax commented on Jul 27, 2020

    @addaleax
    Member

    See nodejs/help#2871, nodejs/help#2874, #34162, etc. – you’re using an outdated version of npm. Updating the npm in your source tree (or updating the graceful-fs within it) should help here.

  3. marcelgsteiger commented on Jul 28, 2020

    @marcelgsteiger
    Author

    Thank you for your quick response. I've been using npm 6.14.5 . Upgrading to 6.14.7 (npm@latest) does not help here. The error persists with node 12.18.3 and vanishes as soon as I go back to 12.18.2 . graceful-fs is already on the latest version 4.2.4. So I believe one of the numerous changes between 12.18.2 and 12.18.3 causes the issue on my platform. I also tried npm 6.14.6 (mentioned as dependency in node 12.18.3) but I get the same error. Could this be specific to my platform or kernel version, perhaps a timing issue? Pls let me know if I can provide some additional information for reproducing/debugging.
    Regards
    Marcel

  4. iamstarkov commented on Aug 5, 2020

    @iamstarkov

    I have the same problem

  5. iamstarkov commented on Aug 5, 2020

    @iamstarkov

    @addaleax I know you may be hesitant to reopen this bug due to prior similar issues with npm and graceful-fs and I've seen them and encountered those issues myself, so I have reasons to believe its a new bug. Please hear me out if not for me but for hundreds of others who experiences the same issue, but do not report.

    I've faced the same bug and updated to latest npm and pinned graceful-fs to the latest version in the yarn.lock and it didnt help. The only fix which worked is to downgrade to node 12.18.2. I'm together with @milProg and think that its a new bug and it is something else.

    Project I struggled with is my company ui kit https://github.com/nordnet/ui/ with semantic-release enabled and as soon 12.8.3 was released and picked by travis release process broke.

    Here is the verifiable points concluded from my investigation of broken releases of our ui kit:

  6. addaleax commented on Aug 5, 2020

    @addaleax
    Member

    @iamstarkov The problem is the semantic-release@16.0.0-beta.18 (hardcoded in your package.json, no semver range) → @semantic-release/npm@^5.2.0-beta.5 → npm@6.5.0 (also hardcoded, no semver range) dependency chain. Simply upgrading your dependencies should be enough. You may not want to rely on beta versions of tools anyway.

  7. iamstarkov commented on Aug 5, 2020

    @iamstarkov

    I will definitely upgrade away from beta in the future.

    Can you elaborate a bit more why this dependency chain is a problem? I don't understand why it stopped working in latest patch release of node. It's a patch release not a minor or a major one.

  8. addaleax commented on Aug 5, 2020

    @addaleax
    Member

    @iamstarkov Right, but graceful-fs (which is not just a dependency of npm, it’s actually shipped as part of the npm package) depends on Node.js internals in a way that does not follow semver. In particular, in this case, we started using a custom option for a file system operation inside of Node.js itself, and the monkey-patched fs module from graceful-fs did not recognize that option in earlier versions.

  9. prionkor commented on Apr 22, 2021

    @prionkor

    Just a FYI, I am having similar problem with node 12 as well as 14 alpine docker containers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateIssues and PRs that are duplicates of other issues or PRs.npmIssues and PRs related to the npm client dependency or the npm registry.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions