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

[BUG] 'Error: EACCES: permission denied' error when using @commitlint/config-nx-scopes #243

Open
jaytavares opened this issue Apr 27, 2022 · 3 comments
Assignees
Labels
help wanted Extra attention is needed

Comments

@jaytavares
Copy link

Describe the bug

Scopes are not loaded from @commitlint/config-nx-scopes. An error is logged in conventional commits extension output.

To reproduce

Steps to reproduce the behavior:

  1. Within an Nx workspace, create .commitlintrc file with contents:
{
  "extends": [
    "@commitlint/config-conventional",
    "@commitlint/config-nx-scopes"
  ]
}
  1. Activate conventional commits extension
  2. View conventional commits output

Expected behavior

Scopes should be loaded based on Nx workspace projects.

Screenshots

none

Application logs

[info] Extension Activated
[info] vscode.env.language: en
[info] last used version: 1.24.0
[info] Conventional commits started.
[info] VSCode version: 1.66.2
[info] Git version: 1.0.0
[info] VSCode Conventional Commits version: 1.24.0
[info] conventionalCommits.autoCommit: true
[info] conventionalCommits.silentAutoCommit: false
[info] conventionalCommits.emojiFormat: code
[info] conventionalCommits.gitmoji: true
[info] conventionalCommits.lineBreak:
[info] conventionalCommits.promptBody: true
[info] conventionalCommits.promptCI: false
[info] conventionalCommits.promptFooter: true
[info] conventionalCommits.promptScopes: true
[info] conventionalCommits.scopes:
[info] conventionalCommits.showEditor: false
[info] conventionalCommits.showNewVersionNotes: true
[info] conventionalCommits.editor.keepAfterSave: false
[info] git.enableSmartCommit: false
[info] git.smartCommitChanges: all
[info] git.postCommitCommand: none
[info] arg: undefined
[info] git.repositories: /Users/jay/dev/demo_project
[info] workspaceFolders: /Users/jay/dev/demo_project
[error] commitlint: The cwd is /Users/jay/dev/demo_project
[error] commitlint: Error: EACCES: permission denied, scandir '/Volumes/Backups of Jason’s MacBook Pro'
at Object.readdirSync (node:fs:1390:3)
at Object.e.readdirSync (node:electron/js2c/asar_bundle:5:10818)
at readdirWithFileTypes (/Users/jay/dev/demo_project/node_modules/@nodelib/fs.scandir/out/providers/sync.js:16:33)
at Object.read (/Users/jay/dev/demo_project/node_modules/@nodelib/fs.scandir/out/providers/sync.js:10:16)
at SyncReader.scandirSync [as _scandir] (/Users/jay/dev/demo_project/node_modules/@nodelib/fs.scandir/out/index.js:17:17)
at SyncReader._handleDirectory (/Users/jay/dev/demo_project/node_modules/@nodelib/fs.walk/out/readers/sync.js:28:34)
at SyncReader._handleQueue (/Users/jay/dev/demo_project/node_modules/@nodelib/fs.walk/out/readers/sync.js:23:18)
at SyncReader.read (/Users/jay/dev/demo_project/node_modules/@nodelib/fs.walk/out/readers/sync.js:15:14)
at SyncProvider.read (/Users/jay/dev/demo_project/node_modules/@nodelib/fs.walk/out/providers/sync.js:11:29)
at ReaderSync.walkSync [as _walkSync] (/Users/jay/dev/demo_project/node_modules/@nodelib/fs.walk/out/index.js:19:21)
at ReaderSync.dynamic (/Users/jay/dev/demo_project/node_modules/fast-glob/out/readers/sync.js:13:21)
at ProviderSync.api (/Users/jay/dev/demo_project/node_modules/fast-glob/out/providers/sync.js:18:33)
at ProviderSync.read (/Users/jay/dev/demo_project/node_modules/fast-glob/out/providers/sync.js:13:30)
at Array.map ()
at getWorks (/Users/jay/dev/demo_project/node_modules/fast-glob/out/index.js:58:18)
at sync (/Users/jay/dev/demo_project/node_modules/fast-glob/out/index.js:19:23)
at globForProjectFiles (/Users/jay/dev/demo_project/node_modules/@nrwl/packages/nx/src/config/workspaces.ts:550:31)
at Workspaces.readWorkspaceConfiguration (/Users/jay/dev/demo_project/node_modules/@nrwl/packages/nx/src/config/workspaces.ts:81:13)
at /Users/jay/dev/demo_project/node_modules/@commitlint/config-nx-scopes/index.js:17:25
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at Object.execute (/Users/jay/.vscode/extensions/vivaxy.vscode-conventional-commits-1.24.0/dist/extension.js:650:19)
at async Promise.all (index 11)
at Object.load [as default] (/Users/jay/.vscode/extensions/vivaxy.vscode-conventional-commits-1.24.0/dist/extension.js:15586:29)
[info] commitlintRuleConfigs:
{}

@jaytavares jaytavares added the help wanted Extra attention is needed label Apr 27, 2022
@vivaxy
Copy link
Owner

vivaxy commented May 3, 2022

It seems the demo_project/node_modules/@nrwl/packages/nx/src/config/workspaces.ts is reading from /Volumes/Backups of Jason’s MacBook Pro with no permission granted.

@jaytavares
Copy link
Author

It seems the demo_project/node_modules/@nrwl/packages/nx/src/config/workspaces.ts is reading from /Volumes/Backups of Jason’s MacBook Pro with no permission granted.

That is the error message; however, there is no reference to that volume in my config nor should Nx be accessing it for any reason. It's just a time machine backup volume. The strange thing is that Commitizen has no problem running in the repo, which is why I posted this issue here instead of somewhere upstream.

It's a bit of a head scratcher. 🤔

@ChristopherMcDonald
Copy link

ChristopherMcDonald commented Dec 29, 2022

FWIW, I have the exact same problem. My errors are...

Conventional Commits: The cwd is /Users/christophermcdonald/repos/<hidden>

Conventional Commits: EBADF: bad file descriptor, lstat '/dev/fd/13'

FWIW, it looks like config-nx-scopes is exporting a rule config of "scope-enum" which looks like a "Supported Commitlint Rule". I would just guess when the rules are loaded, extensions are not being pulled in?

Also, commitlint pulls in the nx scopes fine.

git commit -m "test(none): test" --allow-empty   
⧗   input: test(none): test
✖   scope must be one of [applications, base-config, .... the rest of the nx apps and libs] [scope-enum]

✖   found 1 problems, 0 warnings
ⓘ   Get help: https://github.com/conventional-changelog/commitlint/#what-is-commitlint

husky - commit-msg hook exited with code 1 (error)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants