Skip to content

[BUG] NPM >= 10.8.0 causes NPM installation failures #8179

Open
@kirrg001

Description

@kirrg001

Is there an existing issue for this?

  • I have searched the existing issues

This issue exists in the latest npm version

  • I am using the latest npm

Current Behavior

Hi!

The problem started with NPM 10.8.0.
We are using latest Node v18 version.

With NPM 10.8.0 our dependencies fail to install. We are seeing this warning before the complete installation fails:

npm warn cleanup Failed to remove some directories [
npm warn cleanup   [
npm warn cleanup     '/artifacts/node_modules/node-rdkafka',
npm warn cleanup     [Error: ENOTEMPTY: directory not empty, rmdir '/artifacts/node_modules/node-rdkafka/deps/librdkafka'] {
npm warn cleanup       errno: -39,
npm warn cleanup       code: 'ENOTEMPTY',
npm warn cleanup       syscall: 'rmdir',
npm warn cleanup       path: '/artifacts/node_modules/node-rdkafka/deps/librdkafka'
npm warn cleanup     }
npm warn cleanup   ],
npm warn cleanup   [
npm warn cleanup     '/artifacts/node_modules/kafka-avro/node_modules/node-rdkafka',
npm warn cleanup     [Error: ENOTEMPTY: directory not empty, rmdir '/artifacts/node_modules/kafka-avro/node_modules/node-rdkafka/deps/librdkafka'] {
npm warn cleanup       errno: -39,
npm warn cleanup       code: 'ENOTEMPTY',
npm warn cleanup       syscall: 'rmdir',
npm warn cleanup       path: '/artifacts/node_modules/kafka-avro/node_modules/node-rdkafka/deps/librdkafka'
npm warn cleanup     }
npm warn cleanup   ],
npm warn cleanup   [
npm warn cleanup     '/artifacts/node_modules',
npm warn cleanup     [Error: ENOTEMPTY: directory not empty, rmdir '/artifacts/node_modules/kafka-avro/node_modules/node-rdkafka/deps/librdkafka'] {
npm warn cleanup       errno: -39,
npm warn cleanup       code: 'ENOTEMPTY',
npm warn cleanup       syscall: 'rmdir',
npm warn cleanup       path: '/artifacts/node_modules/kafka-avro/node_modules/node-rdkafka/deps/librdkafka'
npm warn cleanup     }
npm warn cleanup   ],
npm warn cleanup   [
npm warn cleanup     '/artifacts/node_modules/kafka-avro',
npm warn cleanup     [Error: ENOTEMPTY: directory not empty, rmdir '/artifacts/node_modules/kafka-avro/node_modules/node-rdkafka/deps/librdkafka'] {
npm warn cleanup       errno: -39,
npm warn cleanup       code: 'ENOTEMPTY',
npm warn cleanup       syscall: 'rmdir',
npm warn cleanup       path: '/artifacts/node_modules/kafka-avro/node_modules/node-rdkafka/deps/librdkafka'
npm warn cleanup     }
npm warn cleanup   ]

Follow by an extraction error

npm error gyp verb extracted file from tarball node-v18.20.7/include/node/v8-platform.h
npm error gyp verb extracted file from tarball node-v18.20.7/include/node/v8-local-handle.h
npm error gyp verb extracted file from tarball node-v18.20.7/include/node/uv.h
npm error gyp verb extracted file from tarball node-v18.20.7/include/node/v8-script.h
....

Finally resulting in:

npm error /root/.cache/node-gyp/18.20.7/include/node/v8-object.h:19:7: note: forward declaration of 'class v8::Function'
npm error    19 | class Function;
npm error       |       ^~~~~~~~
npm error ../../nan/nan_maybe_43_inl.h: In function 'Nan::MaybeLocal<v8::Object> Nan::NewInstance(v8::Local<v8::Function>, int, v8::Local<v8::Value>*)':
npm error ../../nan/nan_maybe_43_inl.h:53:24: error: invalid use of incomplete type 'class v8::Function'
npm error    53 |   return scope.Escape(h->NewInstance(isolate->GetCurrentContext(), argc, argv)
npm error gyp ERR! build error 
npm error gyp ERR! stack Error: `make` failed with exit code: 2
npm error gyp ERR! stack at ChildProcess.<anonymous> (/artifacts/node_modules/node-gyp/lib/build.js:216:23)
npm error gyp ERR! System Linux 5.4.0-193-generic
npm error gyp ERR! command "/usr/local/bin/node" "/artifacts/node_modules/.bin/node-gyp" "rebuild"
npm error gyp ERR! cwd /artifacts/node_modules/event-loop-stats
npm error gyp ERR! node -v v18.20.7
npm error gyp ERR! node-gyp -v v11.1.0
npm error gyp ERR! not ok
npm verbose cwd /artifacts
npm verbose os Linux 5.4.0-193-generic
npm verbose node v18.20.7
npm verbose npm  v10.8.0

No issues with NPM 10.7.0.

It seems not caused by node-gyp.

Expected Behavior

No failures.

Steps To Reproduce

Currently I cannot reproduce this error in a Docker container.

Environment

Using node: v18.20.4
Using npm: >= 10.8.0
Architecture: x64
Python3 version: Python 3.11.2
Make version: GNU Make 4.3
GCC version: gcc (Debian 12.2.0-14) 12.2.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugthing that needs fixingNeeds Triageneeds review for next steps

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions