jsdoc not built
MidnightJava opened this issue · 7 comments
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?
Hello, what's your npm
version and could your please post the package.json
that includes grunt-jsdoc
?
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"
}
}
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/
- ...
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
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'
}
}
},
"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 :
- Use a previous version of npm
- Update
grunt-jsdoc
to a version still compatible with your other grunt peer dependencies but that supports newernpm
. Check the release history and compatibility sections. - Upgrade all the grunts packages
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.