GithubHelp home page GithubHelp logo

Comments (10)

davidarkemp avatar davidarkemp commented on July 17, 2024
# npm install coffeekup

# coffee

coffee> coffeekup = require 'coffeekup'

Error: Cannot find module 'coffeekup'
    at Function._resolveFilename (module.js:320:11)
    at Function._load (module.js:266:25)
    at require (module.js:348:19)
    at Object.<anonymous> (test.coffee:2:3)
    at Object.<anonymous> (test.coffee:3:4)
    at Module._compile (module.js:404:26)
    at Object.run (.../lib/node/.npm/coffee-script/1.0.1/package/lib/coffee-script.js:55:19)
    at .../lib/node/.npm/coffee-script/1.0.1/package/lib/command.js:115:29
    at .../lib/node/.npm/coffee-script/1.0.1/package/lib/command.js:85:26
    at [object Object].<anonymous> (fs.js:107:5)

from coffeekup.

alduro avatar alduro commented on July 17, 2024

I have exactly the same problem.

from coffeekup.

valpackett avatar valpackett commented on July 17, 2024

Me too :(

from coffeekup.

quickredfox avatar quickredfox commented on July 17, 2024

Temporary Solution, Add:

  "main": "./lib/index"

To package.json... it's been mentioned before and i think there's a patch in one of the pull requests.

from coffeekup.

alduro avatar alduro commented on July 17, 2024

ok, it worked!
aldo@macbook ~/local/node/lib/node/.npm/coffeekup > node

require('coffeekup')
{ version: '0.2.2',
compile: [Function],
render: [Function],
adapters: { simple: [Function], meryl: [Function] } }

and index.js has to be:
module.exports = require('./coffeekup')
and not ./lib/coffeekup

Thanks.

from coffeekup.

alduro avatar alduro commented on July 17, 2024

well, after upgrade npm to 1.0.3 and having installed modules under $HOME/local/node/lib/node_modules/coffeekup the error is back. Any clue ?

from coffeekup.

quickredfox avatar quickredfox commented on July 17, 2024

My guess would be to conduct an investigation on what has changed in the commonJS packages spec and/or how node's "require" follows those changes or not /w regards to what npm also has to say on that. This was the general path I took to figuring it out the last time, it seems to be as it's just a "living on the edge" kinda bug.

from coffeekup.

alduro avatar alduro commented on July 17, 2024

installing coffeekup locally works fine. The problem is when is installed globally.

from coffeekup.

mauricemach avatar mauricemach commented on July 17, 2024

Tested the patch on two machines and still got the issue with or without it. Actually I can't require anything inside the coffee REPL, unless installed globally (in which case even coffeekup works without the patch). Requiring local packages inside the node REPL always works, coffeekup included.

OS: OS X 10.6.8 / Ubuntu 11.04
node: 0.4.8 / 0.4.9
coffeescript: 1.1.1 (both)
npm: 1.0.15 (both)

Jason, does the fix still work for you? How's your environment?

from coffeekup.

mauricemach avatar mauricemach commented on July 17, 2024

Closing since it seems to be fixed in current versions of npm, feel free to reopen if it happens again to you.

from coffeekup.

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.