travist / makemeasandwich.js

A Node.js + Phantom.js command line application that will automatically order you a sandwich from Jimmy John's. ( http://xkcd.com/149 )
MIT License
957 stars 59 forks source link

Cannot find module weak #13

Open plotti opened 10 years ago

plotti commented 10 years ago

➜ ~ makemeasandwich Logging in.

module.js:340 throw err; ^ Error: Cannot find module 'weak' at Function.Module._resolveFilename (module.js:338:15) at Function.Module._load (module.js:280:25) at Module.require (module.js:364:17) at require (module.js:380:17) at new D (/usr/local/lib/node_modules/makemeasandwich/node_modules/jquerygo/node_modules/phantom/node_modules/dnode/index.js:28:20) at module.exports (/usr/local/lib/node_modules/makemeasandwich/node_modules/jquerygo/node_modules/phantom/node_modules/dnode/index.js:8:12) at /usr/local/lib/node_modules/makemeasandwich/node_modules/jquerygo/node_modules/phantom/phantom.js:138:13 at Server.handler (/usr/local/lib/node_modules/makemeasandwich/node_modules/jquerygo/node_modules/phantom/node_modules/shoe/index.js:22:9) at Server.EventEmitter.emit (events.js:95:17) at App.emit (/usr/local/lib/node_modules/makemeasandwich/node_modules/jquerygo/node_modules/phantom/node_modules/shoe/node_modules/sockjs/lib/sockjs.js:182:27) ➜ ~

nmynarcik commented 10 years ago

I'm having the same issue.

travist commented 10 years ago

What version of node.js are you using?

nmynarcik commented 10 years ago

for me: v0.10.29

but I am also getting this when I try to install:

> weak@0.3.3 install /usr/local/lib/node_modules/makemeasandwich/node_modules/jquerygo/node_modules/phantom/node_modules/dnode/node_modules/weak
> node-gyp rebuild
make: *** No rule to make target `../../../../../../../../../../../../../../Users/nathan', needed by `Makefile'.  Stop.
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack     at ChildProcess.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:809:12)
gyp ERR! System Darwin 13.4.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/makemeasandwich/node_modules/jquerygo/node_modules/phantom/node_modules/dnode/node_modules/weak
gyp ERR! node -v v0.10.29
gyp ERR! node-gyp -v v0.13.1
gyp ERR! not ok
travist commented 10 years ago

This seems like it is being included from within the phantom package. I am curious if this is an issue on their end.

jvtrigueros commented 10 years ago

I'm also encountering this issue on Windows 8 using node version v0.10.26.

travist commented 10 years ago

Maybe a windows problem? Has anyone experienced this issue outside of a windows environment?

travist commented 10 years ago

Looks like this might help.

http://stackoverflow.com/questions/23571499/node-js-and-phantomjs-cannot-find-module-weak

travist commented 10 years ago

Ah... maybe there is something I can do to the library that does this... https://github.com/sgentle/phantomjs-node#use-it-in-windows

nmynarcik commented 10 years ago

Well, my experience was in OSX 10.9.5

travist commented 10 years ago

I have seen this before when my Python was outdated and the node-gyp was unable to compile. In my case, I fixed it by upgrading Python using Homebrew.

brew install python

Let me know if that helps.

nmynarcik commented 10 years ago

updating python didn't seem to help. Tried reinstalling makemeasandwich after and this is what I get.

> weak@0.3.3 install /usr/local/lib/node_modules/makemeasandwich/node_modules/jquerygo/node_modules/phantom/node_modules/dnode/node_modules/weak
> node-gyp rebuild
make: *** No rule to make target `../../../../../../../../../../../../../../Users/nathan', needed by `Makefile'.  Stop.
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack     at ChildProcess.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:809:12)
gyp ERR! System Darwin 13.4.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/makemeasandwich/node_modules/jquerygo/node_modules/phantom/node_modules/dnode/node_modules/weak
gyp ERR! node -v v0.10.29
gyp ERR! node-gyp -v v0.13.1
gyp ERR! not ok
> phantomjs@1.9.10 install /usr/local/lib/node_modules/makemeasandwich/node_modules/jquerygo/node_modules/phantomjs
> node install.js
Downloading https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.7-macosx.zip
Saving to /usr/local/lib/node_modules/makemeasandwich/node_modules/jquerygo/node_modules/phantomjs/phantomjs/phantomjs-1.9.7-macosx.zip
Receiving...
[===================================-----] 87% 0.0s
Received 9186K total.
Extracting zip contents
phantom
Writing location.js file
phantomjs
npm WARN optional dep failed, continuing weak@0.3.3
/usr/local/bin/makemeasandwich -> /usr/local/lib/node_modules/makemeasandwich/bin/makemeasandwich
makemeasandwich@0.0.8 /usr/local/lib/node_modules/makemeasandwich
├── underscore@1.7.0
├── async@0.9.0
├── prompt@0.2.14 (revalidator@0.1.8, pkginfo@0.3.0, read@1.0.5, winston@0.8.1, utile@0.2.1)
├── nconf@0.6.9 (ini@1.3.0, async@0.2.9, optimist@0.6.0)
└── jquerygo@0.0.16 (asyncgo@0.0.4, phantom@0.6.5, phantomjs@1.9.10)
travist commented 10 years ago

This actually looks like you do not have the OSX Mac build tools installed which is required to install phantomjs. You can get them with XCode by downloading it from the AppStore. Although, I was able to install them on my machine by typing xcode-select --install in my terminal.

nmynarcik commented 10 years ago

that's odd because I installed them a couple weeks ago...I'll take a look

olivierlesnicki commented 9 years ago

Same issue.

badrul commented 8 years ago

To fix this, I disable 'weak' by setting it to false.

In jquery.go.js, line #73:

Change:

}, { binary: phantomjs.path });

to:

}, { 
    binary: phantomjs.path,
    dnodeOpts: {weak: false}
});

Ref: phantomjs-node/blob/master/README.markdown#use-it-in-windows