typhonjs-node-esdoc / esdoc-plugin-enhanced-navigation

Replaces the standard ESDoc left hand source navigation with an enhanced version.
Mozilla Public License 2.0
4 stars 2 forks source link

npm installation is incomplete #1

Closed jcowgar closed 8 years ago

jcowgar commented 8 years ago

I installed via npm install --save-dev jsdoc-plugin-enhanced-navigation, then setup my esdoc.json file to read:

{
    "source": "./src",
    "destination": "./esdoc",
    "plugins": [
        {
            "name": "esdoc-es7-plugin"
        },
        {
            "name": "esdoc-plugin-enhanced-navigation"
        }
    ]
}

When running esdoc, I then get:

/Users/jeremy/Projects/AMPS/dragon-js/node_modules/esdoc/out/src/Plugin/Plugin.js:94
            throw _iteratorError;
            ^

Error: ENOENT: no such file or directory, stat '/Users/jeremy/Projects/AMPS/dragon-js/node_modules/esdoc-plugin-enhanced-navigation/template/copy'
    at Error (native)
    at Object.fs.statSync (fs.js:892:18)
    at Object.copySync (/Users/jeremy/Projects/AMPS/dragon-js/node_modules/fs-extra/lib/copy-sync/copy-sync.js:20:58)
    at s_COPY_FILES (/Users/jeremy/Projects/AMPS/dragon-js/node_modules/esdoc-plugin-enhanced-navigation/dist/plugin.js:129:21)
    at Object.onHandleConfig (/Users/jeremy/Projects/AMPS/dragon-js/node_modules/esdoc-plugin-enhanced-navigation/dist/plugin.js:60:3)
    at Plugin._execHandler (/Users/jeremy/Projects/AMPS/dragon-js/node_modules/esdoc/out/src/Plugin/Plugin.js:82:30)
    at Plugin.onHandleConfig (/Users/jeremy/Projects/AMPS/dragon-js/node_modules/esdoc/out/src/Plugin/Plugin.js:119:12)
    at Function.generate (/Users/jeremy/Projects/AMPS/dragon-js/node_modules/esdoc/out/src/ESDoc.js:97:44)
    at ESDocCLI.exec (/Users/jeremy/Projects/AMPS/dragon-js/node_modules/esdoc/out/src/ESDocCLI.js:90:28)
    at Object.<anonymous> (/Users/jeremy/Projects/AMPS/dragon-js/node_modules/esdoc/out/src/ESDocCLI.js:146:7)

Looking in the node_modules path for the plugin, I see only dist and src directories. While looking on github, I see the template directory.

Checking out the github project, and copying the template directory into my node_modules/jsdoc-plugin-enhanced-navigation causes this error to go way.

typhonrt commented 8 years ago

Thanks for checking things out. It's a "teething" issue as I forgot to add to add the template directory to package.json and it should be fixed in the recently released 0.0.4 version. Let me know if this fixes the problem.

jcowgar commented 8 years ago

Yup, that solved this problem. #2 is still open, though, of course.

I know what you mean about teething... I published my first npm package yesterday and had to make another rather quick release :-)

typhonrt commented 8 years ago

Working on it.. I'm adding basic sanity checking and 0.0.5 should be out momentarily.. ;P

jcowgar commented 8 years ago

No rush, just reporting.

julienbechade commented 8 years ago

Hi,

I'm having a related problem with 0.0.7 version of this plugin.

/node_modules/esdoc/out/src/Plugin/Plugin.js:94
            throw _iteratorError;
            ^

Error: Cannot find module 'cheerio'
    at Function.Module._resolveFilename (module.js:326:15)
    at Function.Module._load (module.js:277:25)
    at Module.require (module.js:354:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/node_modules/esdoc-plugin-enhanced-navigation/dist/plugin.js:20:16)
    at Module._compile (module.js:410:26)
    at Object.Module._extensions..js (module.js:417:10)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)
    at Module.require (module.js:354:17)
    at require (internal/module.js:12:17)

When looking at the package, the node_modules/ folder is not there. I don't know how you reference external packages but their no trace of required modules in package.json used in dist/plugins.js.

Hope that helps.

Cheers.

typhonrt commented 8 years ago

@julienbechade Do you have esdoc installed? cheerio is a dependency of esdoc and I should probably add esdoc in peerDependencies for esdoc-plugin-enhanced-navigation

Also what version of Node are you using? I've designed things for NPM 3+ / Node 5+ which has a flat package structure. This doesn't immediately look like the problem though.

julienbechade commented 8 years ago

I do have esdoc installed, 0.4.7. Well I guess this is exactly my problem then… We're using Node v4.2.6 and can't upgrade.

julienbechade commented 8 years ago

But can't you list all dependencies nonetheless in package.json and let whatever version of npm resolve the structure…?

typhonrt commented 8 years ago

You can check and verify if there is a node_modules directory with cheerio under ./node_modules/esdoc. With Node 5+ and flat packages it makes it possible to implicitly share dependencies which is useful for plugins.

Not that this is a good solution per se, but you can try adding the following to package.json and see if things resolve:

devDependencies: {
  "cheerio": "^0.20.0",
  "ice-cap": "^0.0.4",
  "taffydb": "^2.0.0"
}
julienbechade commented 8 years ago

Fair enough. I'll do it this way instead then. Thanks for your time!

Cheers.

typhonrt commented 8 years ago

I'll definitely try and find a compromise if possible. Admittedly the flat package hierarchy of Node 5+ is a strong inflection point per se for structuring releases especially plugin oriented distributions. I wished there was a way to have NPM fail in installing for Node versions less than 5, but only a warning can be generated. With the release of Node 6 and subsequently it becoming the new LTS soon we are kind of in the that border range where old and new styles coexist. Both esdoc-plugin-enhanced-navigation and esdoc-plugin-dependency-graphs reflect this state of flux being in 0.0.x versioning. Thanks for your patience. I certainly understand being stuck on an old Node distribution as a VPS provider I have / and use(d) in the past is also stuck on v.4. In general I'm aiming TyphonJS at deploying to hosts that can support Node 5+.

typhonrt commented 8 years ago

@julienbechade give the 0.1.0 release a try and let me know if things don't work on Node v4. Thanks!