Coder Social home page Coder Social logo

Comments (12)

shahdhruvin avatar shahdhruvin commented on August 29, 2024 1

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.

from frisby.

kvarkson avatar kvarkson commented on August 29, 2024

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.

from frisby.

vlucas avatar vlucas commented on August 29, 2024

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

from frisby.

sacashgit avatar sacashgit commented on August 29, 2024

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

from frisby.

shahdhruvin avatar shahdhruvin commented on August 29, 2024

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 !

from frisby.

vlucas avatar vlucas commented on August 29, 2024

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.

from frisby.

harirordeveloper avatar harirordeveloper commented on August 29, 2024

i followed shahdhruvin comment
Thanks guys worked for me :)

from frisby.

benoror avatar benoror commented on August 29, 2024

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

from frisby.

yuankui avatar yuankui commented on August 29, 2024

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

from frisby.

RobertHerhold avatar RobertHerhold commented on August 29, 2024

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. :)

from frisby.

yuankui avatar yuankui commented on August 29, 2024

@RobertHerhold that's cool

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

choose your like

from frisby.

marcin-wosinek avatar marcin-wosinek commented on August 29, 2024

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

from frisby.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.