Skip to content

Error [ERR_REQUIRE_ESM]: require() of ES Module /usr/local/lib/node_modules/node-gyp/node_modules/env-paths/index.js from /usr/local/lib/node_modules/node-gyp/bin/node-gyp.js not supported. #3239

@sam17896

Description

@sam17896

So our builds start seeing the following error few minutes ago, our last build was successful 2 hours ago. I notice a new version of the package is just published which may caused the issue.

Complete Error Message

npm ERR! Node.js v20.8.1
npm ERR! 
npm ERR! }
npm ERR!   code: 'ERR_REQUIRE_ESM'
npm ERR!     at Object.<anonymous> (/usr/local/lib/node_modules/node-gyp/bin/node-gyp.js:7:31) {
npm ERR! Instead change the require of index.js in /usr/local/lib/node_modules/node-gyp/bin/node-gyp.js to a dynamic import() which is available in all CommonJS modules.
npm ERR! Error [ERR_REQUIRE_ESM]: require() of ES Module /usr/local/lib/node_modules/node-gyp/node_modules/env-paths/index.js from /usr/local/lib/node_modules/node-gyp/bin/node-gyp.js not supported.
npm ERR! 
npm ERR!                               ^
npm ERR! const { default: envPaths } = require('env-paths')
npm ERR! /usr/local/lib/node_modules/node-gyp/bin/node-gyp.js:7
npm ERR! command sh -c node-gyp-build
npm ERR! command failed
npm ERR! path /usr/local/lib/node_modules/bcrypt
npm ERR! code 1
 ---> Running in 5e0ce068602f
Step 5/42 : RUN npm --build-from-source install -g bcrypt --unsafe-perm

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions