Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running frisby seems to require frisby module installed locally. #25

Closed
davezen1 opened this issue Apr 15, 2013 · 12 comments
Closed

Running frisby seems to require frisby module installed locally. #25

davezen1 opened this issue Apr 15, 2013 · 12 comments

Comments

@davezen1
Copy link

I received module not found errors when attempting to run frisby from the command like so:

jasmine-node spec/api/

I installed frisby globally like so:

npm install -g frisby

My node version is : v0.10.4 global only and frisby version 0.6.7 locally and globally

@kvarkson
Copy link

If your npm version 1.0+ take a look at http://blog.nodejs.org/2011/04/06/npm-1-0-link/#link_global_local link. Just link your global module to the local repository and this is it.

It works for me.

@vlucas
Copy link
Owner

vlucas commented Jul 15, 2013

Did you get this resolved with @kvarkson's comment?

@sacashgit
Copy link

I am getting the exact same error.. Not able to use frisby for API testing..

@shahdhruvin
Copy link

I tried what @kvarkson suggested above, like this:
Using the admin user (sudo su)
frisby$npm link frisby
/usr/local/lib/node_modules/frisby/node_modules/frisby -> /usr/local/lib/node_modules/frisby

I still get the exact same error:
jasmine-node spec/api/
Exception loading: /Users/dvin2684/try_frisby/spec/api/first_spec.js
{ [Error: Cannot find module 'frisby'] code: 'MODULE_NOT_FOUND' }

Please help !

@shahdhruvin
Copy link

Try using absolute PATH to frisby:
Like this: var frisby = require('/usr/local/lib/node_modules/frisby');
Instead of: var frisby = require('frisby');

It worked for me.

@vlucas
Copy link
Owner

vlucas commented Apr 29, 2014

The best solution is to require frisby in your package.json file so you can require it with just require('frisby') instead of installing it globally.

@harirordeveloper
Copy link

i followed shahdhruvin comment
Thanks guys worked for me :)

@benoror
Copy link

benoror commented Jan 16, 2015

isn't it expected to work globally out of the box, the same way jasmine-node does?

@yuankui
Copy link

yuankui commented May 20, 2015

I follow @vlucas advice, add a package.json file

{
    "name": "mytest",
    "version": "1.0",
    "dependencies": {
        "frisby": "*"
    }
}

and run npm install or npm link
then i finnaly can require("frisby") directly in my test script

@RobertHerhold
Copy link

Why not just do npm install frisby --save-dev and then require it later var frisby = require('frisby') ?

Pretty much what @yuankui said, but shorter and appropriately defined as a development dependency. :)

@yuankui
Copy link

yuankui commented May 20, 2015

@RobertHerhold that's cool

and I just find another way, export NODE_PATH="'$(npm root -g)'"

choose your like

@marcin-wosinek
Copy link
Collaborator

I'm sure frisby should be managed as a dev-dep. Api changes are likely, and users will be better of updating their test suites gradually.

I've PR change in documentation:
vlucas/frisby-site#4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants