Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jsdoc not built #182

Closed
MidnightJava opened this issue Apr 10, 2018 · 7 comments
Closed

jsdoc not built #182

MidnightJava opened this issue Apr 10, 2018 · 7 comments

Comments

@MidnightJava
Copy link

When I run grunt-jsdoc, jsdoc fails because none of its dependencies are present. In fact, there is no node_modules directory in ...grunt-jsdoc/node_modules/jsdoc. I cd into that directory and run npm i, and then I can execute grunt-jsdoc without errors.

I assume I should not have to do that. Is there something else I need to do to cause jsdoc dependencies to be built?

@krampstudio
Copy link
Owner

Hello, what's your npm version and could your please post the package.json that includes grunt-jsdoc ?

@MidnightJava
Copy link
Author

npm version is 5.6.0.

Here are redacted contents of the package.json which is used to build grunt-jsdoc. I assume the deps and dev-deps is what you wanted to see, but please let me know if you need more info from the file.

{
  ...
  "dependencies": {
    "loglevel": "^1.4.1",
    "spin": "0.0.1",
    "tinycolor2": "^1.4.1"
  },
  "devDependencies": {
    "catharsis": "^0.7.0",
    "express": "^4.13.4",
    "grunt": "^0.4.1",
    "grunt-browserify": "^5.0.0",
    "grunt-cli": "^0.1.9",
    "grunt-closure-compiler": "^0.0.21",
    "grunt-contrib-clean": "^0.5.0",
    "grunt-contrib-compress": "^0.9.1",
    "grunt-contrib-concat": "^0.3.0",
    "grunt-contrib-jshint": "^0.8.0",
    "grunt-contrib-qunit": "^0.5.0",
    "grunt-express-server": "^0.5.3",
    "grunt-jsbeautifier": "^0.2.13",
    "grunt-jsdoc": "^0.5.4",
    "grunt-karma": "^0.12.2",
    "grunt-open": "^0.2.3",
    "grunt-services": "^0.1.0",
    "grunt-shell-spawn": "^0.3.10",
    "grunt-text-replace": "^0.4.0",
    "grunt-web-server": "^1.2.3",
    "jasmine": "^2.4.1",
    "karma": "^0.13.0",
    "karma-chrome-launcher": "^1.0.1",
    "karma-firefox-launcher": "^1.0.0",
    "karma-jasmine": "^0.3.8",
    "karma-qunit": "^1.1.0",
    "marked": "^0.3.6",
    "qunitjs": "^1.13.0",
    "taffydb": "^2.7.3",
    "underscore": "^1.8.3"
  }
}

@krampstudio
Copy link
Owner

krampstudio commented Apr 10, 2018

With npm 5.6.0 all your dependencies should have been installed, flattened in the node_modules folder next to your package.json. So you should have

package.json
node_modules/
  - grunt/
  - grunt-jsdoc/
  - jsdoc/
  - ...

@MidnightJava
Copy link
Author

MidnightJava commented Apr 10, 2018

Yes, I do have the required packages installed there (e.g. underscore is the first one that fails dependency check). But if I delete the node_modules folder inside the grunt-jsdoc/node_modules/jsdoc folder, jsdoc throws an exception, like this:

$ grunt jsdoc
Running "jsdoc:project1" (jsdoc) task
>> An error occurs in jsdoc process:
>> js: "/opt/git/project1/node_modules/grunt-jsdoc/node_modules/jsdoc/jsdoc.js", line 316: exception 
from uncaught JavaScript throw: Error: Module "underscore" not found.
Warning: jsdoc failure Use --force to continue.

Aborted due to warnings.
 $ ls ./node_modules/ | grep underscore
underscore
underscore.string

@MidnightJava
Copy link
Author

Here is the jsdoc task entry in Gruntfile.js

jsdoc: {
            project1: {
                src: ['js/*.js'],
                options: {
                    destination: 'doc',
                    template: 'docstrap-master/template',
                    configure: 'docstrap-master/conf.json'
                }
            }
        },

@krampstudio
Copy link
Owner

"grunt-jsdoc": "^0.5.4",
is a pretty old version that works only with old versions of npm and old version of jsdoc.

You have multiple possibilities :

  1. Use a previous version of npm
  2. Update grunt-jsdoc to a version still compatible with your other grunt peer dependencies but that supports newer npm. Check the release history and compatibility sections.
  3. Upgrade all the grunts packages

@MidnightJava
Copy link
Author

Thanks for your help! I updated to the latest version of grunt-jsdoc, and it works properly. Don't know why I didn't think of trying that first.

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

No branches or pull requests

2 participants