Skip to content
This repository has been archived by the owner on Jan 19, 2024. It is now read-only.

require('raml-javascript-generator') fails on windows #11

Open
cmorrisonSMS opened this issue Apr 27, 2016 · 1 comment
Open

require('raml-javascript-generator') fails on windows #11

cmorrisonSMS opened this issue Apr 27, 2016 · 1 comment

Comments

@cmorrisonSMS
Copy link

Hi,

I have done npm install raml-javascript-generator, however, when I attempt to actually require in the library in a script, it is failing:

This:

jsGen = require('raml-javascript-generator');
var output = jsGen.client("raw.raml");

Fails with this:

C:\devel\raml-generator-test
λ node .\index.js
module.js:341
    throw err;
    ^

Error: Cannot find module 'raml-javascript-generator'
    at Function.Module._resolveFilename (module.js:339:15)
    at Function.Module._load (module.js:290:25)
    at Module.require (module.js:367:17)
    at require (internal/module.js:16:19)
    at Object.<anonymous> (C:\devel\raml-generator-test\index.js:1:71)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)

require('raml-javascript-generator/dist') appears to work (followed by other errors), but it not what the readme says, so seems incorrect.

Any help would be appreciated.

@blakeembrey
Copy link
Contributor

Looks like package.json has an outdated main. However, when you change it to /dist it's probably breaking because it doesn't accept a string, it accepts an object. Why not just use the CLI?

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

No branches or pull requests

2 participants