Skip to content

Failed to bundle npm as a dependency: Cannot find module 'node-gyp/bin/node-gyp' #275

@styfle

Description

@styfle

I can't seem to bundle npm as a runtime dependency.

This is necessary to get Package Phobia on Now 2.0.

Steps to reproduce

git clone https://github.com/styfle/ncc-bug-npm
cd ncc-bug-npm
ncc build index.js
node dist/index.js

Error output

internal/modules/cjs/loader.js:583
    throw err;
    ^

Error: Cannot find module 'node-gyp/bin/node-gyp'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
    at resolveFileName (/Users/styfle/Desktop/ncc-bug-npm/dist/index.js:95521:39)
    at resolveFrom (/Users/styfle/Desktop/ncc-bug-npm/dist/index.js:95535:9)
    at module.exports.module.exports (/Users/styfle/Desktop/ncc-bug-npm/dist/index.js:95538:41)
    at Object.<anonymous> (/Users/styfle/Desktop/ncc-bug-npm/dist/index.js:33356:31)
    at __webpack_require__ (/Users/styfle/Desktop/ncc-bug-npm/dist/index.js:22:30)
    at Object.<anonymous> (/Users/styfle/Desktop/ncc-bug-npm/dist/index.js:47941:19)
    at __webpack_require__ (/Users/styfle/Desktop/ncc-bug-npm/dist/index.js:22:30)
    at Object.<anonymous> (/Users/styfle/Desktop/ncc-bug-npm/dist/index.js:73093:32)
    at __webpack_require__ (/Users/styfle/Desktop/ncc-bug-npm/dist/index.js:22:30)
    at Object.module.exports.module.exports (/Users/styfle/Desktop/ncc-bug-npm/dist/index.js:92854:14)
    at __webpack_require__ (/Users/styfle/Desktop/ncc-bug-npm/dist/index.js:22:30)
    at Object.<anonymous> (/Users/styfle/Desktop/ncc-bug-npm/dist/index.js:22110:19)
    at __webpack_require__ (/Users/styfle/Desktop/ncc-bug-npm/dist/index.js:22:30)
    at Object.<anonymous> (/Users/styfle/Desktop/ncc-bug-npm/dist/index.js:57109:13)
    at __webpack_require__ (/Users/styfle/Desktop/ncc-bug-npm/dist/index.js:22:30)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions