Code Monkey home page Code Monkey logo

Comments (2)

malaporte avatar malaporte commented on August 25, 2024

As far as I know the algorithm is supposed to mimic Node's behavior, as described here: https://nodejs.org/api/modules.html

You can see that it explicitly looks for a prefix before loading anything from the filesystem. Non-prefixed modules are always loaded from the node_modules folder.

This being said, maybe there is something incorrect in the code. Can you provide a sample that works in Node and breaks with this library?

from nashorn-commonjs-modules.

abonstu avatar abonstu commented on August 25, 2024

If you've just followed the spec then i guess thats right approach.

I had my modules stored under a different path (not node_modules), but as mentioned, this meant modules failed to load dependencies as they are typically referenced without a path prefix.

I've now restructured things to use a node_modules directory instead which resolves the issue.

Thanks for your help :)

from nashorn-commonjs-modules.

Related Issues (20)

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.