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

npmignore includes necessary test directory #2095

Open
charles-goode opened this issue Nov 7, 2023 · 0 comments
Open

npmignore includes necessary test directory #2095

charles-goode opened this issue Nov 7, 2023 · 0 comments

Comments

@charles-goode
Copy link

Input code

I'm trying to use jsdoc@5.0.0-dev.11 tag in order to develop a version of my jsdoc plugin that will be compatible with 5.x. Since jsdoc 5.x is not published to npm, I cloned it and installed locally. However, when I try to run jsdoc, I get an error.

JSDoc configuration

My npm script is jsdoc -c jsdoc.config.js -r and my jsdoc.config.js file is this

{
    "plugins": ["plugin"],
    "source": {
        "include": ["examples"],
        "includePattern": ".+\\.(c|m)*js(doc|x)?$",
        "excludePattern": "(^|\\/|\\\\)_"
    },
    "sourceType": "module",
    "tags": {
        "allowUnknownTags": true,
        "dictionaries": ["jsdoc","closure"]
    },
    "templates": {
        "cleverLinks": false,
        "monospaceLinks": false
    }
}

JSDoc debug output

Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/home/me/jsdoc-plugin/node_modules/jsdoc/test/index.js' imported from /home/me/jsdoc-plugin/node_modules/jsdoc/cli.js

Expected behavior

jsdoc runs without an error

Current behavior

Throws an error on invocation because the test directory is missing. This is because test/ is included in the .npmignore for the jsdoc package. Yet cli.js imports it. Once I install, test/ is missing so cli.js throws the error.

Your environment

Software Version
JSDoc 5.0.0-dev.11
Node.js v18.13.0
npm 9.2.0
Operating system Debian Linux (Bookworm)
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

1 participant