cskr/grasshopper

Error: Cannot find module 'grasshopper'

Closed this issue · 6 comments

I followed all the install instruction (OS X) and I am just trying to run the hello.js but if always fails with the fallowing error:

Error: Cannot find module 'grasshopper'

Any help would be great.

cskr commented

Have you installed npm and installed grasshopper through it?

Yes I have installed npm and used that to install Grasshopper.

npm install grasshopper .

sudo npm install grasshopper
Password:
npm ERR! sudon't!
npm ERR! sudon't! Running npm as root is not recommended!
npm ERR! sudon't! Seriously, don't do this!
npm ERR! sudon't!
npm info it worked if it ends with ok
npm info using npm@0.2.5-1
npm info install grasshopper@0.3.1
npm info preinstall grasshopper@0.3.1
npm info install grasshopper@0.3.1
npm info postinstall grasshopper@0.3.1
npm info activate grasshopper@0.3.1
npm info predeactivate grasshopper@0.3.1
npm info deactivate grasshopper@0.3.1
npm info postdeactivate grasshopper@0.3.1
npm info preactivate grasshopper@0.3.1
npm info activate grasshopper@0.3.1
npm info postactivate grasshopper@0.3.1
npm info build Success: grasshopper@0.3.1
npm ok

cskr commented

So are you cloning the git repository and then installing from it? I see a '.' in that install command!

I verified on a clean machine and both git repository and installing from the NPM registry works just fine.

Just to be sure, try these commands

npm uninstall grasshopper
npm cache clean
npm install grasshopper

I ran the commands you posted but I still get the same error when I try to run hello.js

Error: Cannot find module 'grasshopper'
at loadModule (node.js:275:15)
at require (node.js:411:14)
at Object. (/Users/XXXX.XXXXXXXX/Sites/nodes/grasshopper/hello.js:1:72)
at Module._compile (node.js:462:23)
at Module._loadScriptSync (node.js:469:10)
at Module.loadSync (node.js:338:12)
at Object.runMain (node.js:522:24)
at Array. (node.js:756:12)
at EventEmitter._tickCallback (node.js:55:22)
at node.js:772:9

cskr commented

Your stacktrace looks odd. Can you post the actual source code you're trying to execute and the command you use to execute it?

cskr commented

Closing it as it works everywhere else and the given info is not sufficient to help with debugging.