Cannot Find Module "Flatiron"

115 views
Skip to first unread message

Philip Weaver

unread,
Jun 14, 2012, 6:17:46 PM6/14/12
to Flatiron
When I try to run app.js, I get an error: "Cannot Find Module
"Flatiron". I installed FlatIron like this.

What should I do now?

> npm install flatiron -g
> npm install union
> flatiron create myproject
> node app.js

and then --->

module.js:337
throw new Error("Cannot find module '" + request + "'");
^
Error: Cannot find module 'flatiron'
at Function._resolveFilename (module.js:337:11)
at Function._load (module.js:279:25)
at Module.require (module.js:359:17)
at require (module.js:375:17)
at Object.<anonymous> (/Users/philip/Development/projects/projects/
Dolbey/nodejs/dolbey/app.js:2:16)
at Module._compile (module.js:446:26)
at Object..js (module.js:464:10)
at Module.load (module.js:353:31)
at Function._load (module.js:311:12)
at Array.0 (module.js:484:10)

Joshua Holbrook

unread,
Jun 14, 2012, 6:29:02 PM6/14/12
to flati...@googlegroups.com
Hey Philip,

Try steps more like this:

>> npm install flatiron -g # does not expose the flatiron library to your projects, just installs the cli tool for you
>> flatiron create myapp
>> cd myapp
>> npm install # installs all required dependencies locally inside the project
>> node app.js # will now work

:)

Cheers,

--Josh
--
Joshua Holbrook
Engineer
Nodejitsu Inc.
jo...@nodejitsu.com

Philip Weaver

unread,
Jun 14, 2012, 10:09:06 PM6/14/12
to Flatiron
On the Flatiron page, this verbiage is pretty bad and somebody ought
to review it. They don't read like steps - they read like
alternatives: "You can also..."

"You can also simply include flatiron in your package.json and install
locally with npm"
"Installing your dependencies with npm will install flatiron and all
nested dependencies"

Joshua Holbrook

unread,
Jun 14, 2012, 10:10:20 PM6/14/12
to flati...@googlegroups.com
Which flatiron page? There are a few of them.

--Josh

Philip Weaver

unread,
Jun 14, 2012, 10:16:15 PM6/14/12
to Flatiron
http://flatironjs.org/

"You can also simply include flatiron in your package.json and install
locally with npm."

These steps are not precise.

FlatIron is rad. I'm a fan - especially a fan of using the DOM to
assemble page rendering. Woot!

Thank you Joshua!

On Jun 14, 9:10 pm, Joshua Holbrook <josh.holbr...@gmail.com> wrote:
> Which flatiron page? There are a few of them.
>
> --Josh
>
> On Thu, Jun 14, 2012 at 7:09 PM, Philip Weaver <philma...@gmail.com> wrote:
> > On the Flatiron page, this verbiage is pretty bad and somebody ought
> > to review it. They don't read like steps - they read like
> > alternatives: "You can also..."
>
> > "You can also simply include flatiron in your package.json and install
> > locally with npm"
> > "Installing your dependencies with npm will install flatiron and all
> > nested dependencies"
>
> --
> Joshua Holbrook
> Engineer
> Nodejitsu Inc.
> j...@nodejitsu.com

Philip Weaver

unread,
Jun 14, 2012, 10:25:58 PM6/14/12
to Flatiron
Install FlatIron

> sudo npm install flatiron -g

Navigate to a directory which will contain your new application and
run: (note: the existing installation step provides no example for
type)

> flatiron create <app-name> <type>

Switch to inside this new directory:

> cd <app-name>

The following command will install any dependencies which the
generated application might require:

> npm install

Now run your application:

> node app.js
Reply all
Reply to author
Forward
0 new messages