This is a read-only archive of the Framer Community on Facebook.

What is Framer? Join the Community
Return to index
Arron J Hunt
Posted Sep 08 - Read on Facebook

[SOLVED] How can I create a module with a dependency (pulling in another module)? For example I'm creating a testModule and need to use Wahlström's textLayer module. I tried requiring it before the testModule but no dice.

9 Comments

John Anthony Evans

Framer uses NPM. Here is a tutorial on how to do that.

http://blog.nodejitsu.com/package-dependencies-done-right/

Arron J Hunt

To clarify, I'm importing both modules, but `testModule` doesn't understand that the `textLayer` module has already been required

Joshua Tucker

Hey Aaron! Where are you setting that require? In the module itself or in the Framer project? Here's a screenshot of one of the modules I'm working on with a project - note that I'm requiring other modules as well. Sorry it's a Dropbox screenshot - not at my computer at the moment.

Jordan Robert Dobson

^ Yep this is what I do too!

Arron J Hunt

Joshua I tried both in the project and in the module itself. Where do those modules live in relationship to the one you showed, in the same directory? I have a feeling it's just a folder structure issue I'm having.

Joshua Tucker

All the modules are located inside /modules.

John Anthony Evans

What happens when you run 'npm test'

Jordan Robert Dobson

For me they all live inside the modules folder.

Arron J Hunt

Thanks everyone, looks like something was broken in my project. I created a new one and it worked. Weird.

Read the entire post on Facebook