jakejs / jake

JavaScript build tool, similar to Make or Rake. Built to work with Node.js.
http://jakejs.com
Apache License 2.0
1.97k stars 190 forks source link

Require call fails to find 'jake' #360

Closed terracubist closed 5 years ago

terracubist commented 5 years ago

On Windows 10, node v10.16.1, npm 6.9.0

Installed jake, appears to work somewhat with calls to jake -h. I have a Jakefile that has var JAKE = require("jake"); which fails. Full --trace output:

jake aborted.
Error: Cannot find module 'jake'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
    at Function.Module._load (internal/modules/cjs/loader.js:562:25)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.<anonymous> (C:\Users\TFung\Desktop\github_svn\cappuccino-web-apps\cappuccino-web-apps-stable-6.0\cupajo\Jakefile:2:12)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
mde commented 5 years ago

Jake is a CLI tool, not usually integrated into other programs. Why are you attempting to require it?

terracubist commented 5 years ago

No idea. Didn't make the jakefile and there appear to be other issues with it anyway

kibertoad commented 5 years ago

@TrevorFung It should work when integrated into application just fine, though. Take a look at https://github.com/kibertoad/cli-testlab (admittedly doesn't use much of jake, but basic call is there).