You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I expect it to resolve all files/paths and build documentation
Actual Behavior
It fails to build the documentation and crashes.
The error showing in terminal is:
> angular-tour-of-heroes@1.0.0 docs ~/development/angular-tour-of-heroes
> typedoc -- --options typedoc.json --exclude '**/*.spec.ts' ./src/
fs.js:114
throw err;
^
Error: ENOTDIR: not a directory, scandir '~/node_modules/@babel-code-frame-7.0.0-beta.44.tgz'
at Object.readdirSync (fs.js:790:3)
at FS.readdirSync.forEach (~/development/angular-tour-of-heroes/node_modules/typedoc/dist/lib/utils/plugins.js:72:24)
at Array.forEach (<anonymous>)
at discoverModules (~/development/angular-tour-of-heroes/node_modules/typedoc/dist/lib/utils/plugins.js:69:38)
at discover (~/development/angular-tour-of-heroes/node_modules/typedoc/dist/lib/utils/plugins.js:61:21)
at PluginHost.discoverNpmPlugins (~/development/angular-tour-of-heroes/node_modules/typedoc/dist/lib/utils/plugins.js:54:9)
at PluginHost.load (~/development/angular-tour-of-heroes/node_modules/typedoc/dist/lib/utils/plugins.js:16:46)
at CliApplication.bootstrap (~/development/angular-tour-of-heroes/node_modules/typedoc/dist/lib/application.js:42:22)
at CliApplication.bootstrap (~/development/angular-tour-of-heroes/node_modules/typedoc/dist/lib/cli.js:24:30)
at new Application (~/development/angular-tour-of-heroes/node_modules/typedoc/dist/lib/application.js:31:14)
After some debugging, the breaking happens with this specific line path = Path.resolve(Path.join(previous, '..'));
It seems to get all node_modules in the local directory then it traverses up every directory until it gets to my home directory node_modules and then it breaks looking for that module for whatever reason.
When I comment that line out completely it works fine. Being that I am not 100% sure what this function does completely in the scheme of typedoc, I'm hesitant to submit a PR.
Introduced with #736. We assumed that files under node_modules that start with @ are folders used for npm's scoped packages, but this clearly isn't a safe assumption as you've found. Adding a check to ensure that it is a directory before trying to check its children should fix the issue.
That said, I recall some discussion somewhere (either in gitter or an issue, I can't seem to find it) about removing automatic plugin discovery since it makes load order considerably harder to follow and may include plugins you don't expect if one of your dependencies had them in their dependencies instead of devDependencies for some reason.
@Gerrit0 No problem! I just didn't want this to get lost in the ether. I have solved the solution for now by just removing the global node_modules folder in the user directory. Not sure what other issues this can and/or will pose.
Expected Behavior
I expect it to resolve all files/paths and build documentation
Actual Behavior
It fails to build the documentation and crashes.
The error showing in terminal is:
After some debugging, the breaking happens with this specific line
path = Path.resolve(Path.join(previous, '..'));
It seems to get all
node_modules
in the local directory then it traverses up every directory until it gets to my home directorynode_modules
and then it breaks looking for that module for whatever reason.When I comment that line out completely it works fine. Being that I am not 100% sure what this function does completely in the scheme of typedoc, I'm hesitant to submit a PR.
Steps to reproduce the bug
npm run build
npm run docs
typedoc.js
package.json
Environment
The text was updated successfully, but these errors were encountered: