Code Monkey home page Code Monkey logo

Comments (7)

vweevers avatar vweevers commented on May 29, 2024 1

I see. Yeah, that scenario is not supported by prebuildify-cross. It can only mount one node_modules folder in the Docker container, and expects all dependencies to be there.

from prebuildify-cross.

vweevers avatar vweevers commented on May 29, 2024 1

Sounds good! PR welcome.

from prebuildify-cross.

vweevers avatar vweevers commented on May 29, 2024

Did you run npm install --save-dev prebuildify node-gyp prebuildify-cross?

The Error: canceled error comes from https://github.com/npm/cli/blob/v8.19.2/workspaces/libnpmexec/lib/index.js#L230 and got an improved message in a later version of npm: npm/cli@02c7ddb. It indicates that dependencies are missing.

from prebuildify-cross.

kirrg001 avatar kirrg001 commented on May 29, 2024

I installed the dependencies you have mentioned in the root of my lerna project and in the package itself. Both does not work. The problem is that npm workspaces installs them on the root node_modules folder. I guess that's why a dependency cannot be found.

from prebuildify-cross.

kirrg001 avatar kirrg001 commented on May 29, 2024

Would you accept a pull request? I can take a look

from prebuildify-cross.

vweevers avatar vweevers commented on May 29, 2024

What solution do you suggest?

from prebuildify-cross.

kirrg001 avatar kirrg001 commented on May 29, 2024

I would add a second volume which overrides the node_modules folder.

    const child = dockerRun(image, {
      entrypoint: 'node',
      argv: ['-'].concat(argv),
      remove: false,
      volumes: {
        // Should but can't use :ro (mafintosh/docker-run#12)
        [cygwin(cwd)]: '/input',
        [path.join(cwd, '..', '..', 'node_modules')]: '/input/node_modules'
      },
      env: {
        PREBUILDIFY_CROSS_FILES: files,
        // Disable npm update check
        NO_UPDATE_NOTIFIER: 'true'
      }
    })

If you pass an argv argument e.g. --node-modules-path /absolute/path/to/node_modules we will add the second volume, otherwise by default there is only one volume.

from prebuildify-cross.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.