question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

npm excute arg expected "--commitlint" but actualy "--" "commitlint" at yarn v3 PnP.

See original GitHub issue

npm execute arg expected “–commitlint” but actualy “–” “commitlint” at yarn v3 PnP.

Look this npm error log

$ git commit --file=/var/folders/sv/5vy67rf97ls0v_bhw8kv9vfm0000gn/T/EA6A451D-530A-451E-9E1E-176154BDFB09

(node:86392) ExperimentalWarning: --experimental-loader is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
[STARTED] Preparing lint-staged...
[SUCCESS] Preparing lint-staged...
[STARTED] Running tasks for staged files...
[STARTED] .husky/lintstagedrc.js — 1 file
[STARTED] *.{js,jsx,ts,tsx} — 1 file
[STARTED] {!(package)*.json,*.code-snippets,.!(browserslist)*rc} — 0 file
[STARTED] package.json — 0 file
[STARTED] *.vue — 0 file
[STARTED] *.{css,scss,less,styl,html,js,jsx,ts,tsx} — 1 file
[STARTED] *.md — 0 file
[SKIPPED] {!(package)*.json,*.code-snippets,.!(browserslist)*rc} — no files
[SKIPPED] package.json — no files
[SKIPPED] *.vue — no files
[SKIPPED] *.md — no files
[STARTED] eslint --fix
[STARTED] prettier --write
[SUCCESS] prettier --write
[SUCCESS] *.{css,scss,less,styl,html,js,jsx,ts,tsx} — 1 file
[SUCCESS] eslint --fix
[STARTED] prettier --write
[SUCCESS] prettier --write
[SUCCESS] *.{js,jsx,ts,tsx} — 1 file
[SUCCESS] .husky/lintstagedrc.js — 1 file
[SUCCESS] Running tasks for staged files...
[STARTED] Applying modifications from tasks...
[SUCCESS] Applying modifications from tasks...
[STARTED] Cleaning up temporary files...
[SUCCESS] Cleaning up temporary files...
🔍  Finding changed files since git revision c7d7ed1.
🎯  Found 1 changed file.
✅  Everything is awesome!
npm ERR! canceled

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/yuhansol/.npm/_logs/2022-01-24T00_26_59_329Z-debug-0.log
husky - commit-msg hook exited with code 1 (error)
cat /Users/yuhansol/.npm/_logs/2022-01-24T00_26_59_329Z-debug-0.log
0 verbose cli [
0 verbose cli   '/Users/yuhansol/.nvm/versions/node/v16.13.0/bin/node',
0 verbose cli   '/opt/homebrew/lib/node_modules/npm/bin/npm-cli.js',
0 verbose cli   'exec',
0 verbose cli   '--no-yes',
0 verbose cli   '--',
0 verbose cli   'commitlint',
0 verbose cli   '--edit',
0 verbose cli   ''
0 verbose cli ]
1 info using npm@8.3.0
2 info using node@v16.13.0
3 timing npm:load:whichnode Completed in 0ms
4 timing config:load:defaults Completed in 0ms
5 timing config:load:file:/opt/homebrew/lib/node_modules/npm/npmrc Completed in 1ms
6 timing config:load:builtin Completed in 2ms
7 timing config:load:cli Completed in 1ms
8 timing config:load:env Completed in 0ms
9 timing config:load:file:/Users/yuhansol/workspace/brandi-ai-cms-react/.npmrc Completed in 0ms
10 timing config:load:project Completed in 0ms
11 timing config:load:file:/Users/yuhansol/.npmrc Completed in 1ms
12 timing config:load:user Completed in 1ms
13 timing config:load:file:/opt/homebrew/etc/npmrc Completed in 0ms
14 timing config:load:global Completed in 0ms
15 timing config:load:validate Completed in 0ms
16 timing config:load:credentials Completed in 1ms
17 timing config:load:setEnvs Completed in 0ms
18 timing config:load Completed in 5ms
19 timing npm:load:configload Completed in 5ms
20 timing npm:load:setTitle Completed in 6ms
21 timing config:load:flatten Completed in 1ms
22 timing npm:load:display Completed in 1ms
23 verbose logfile /Users/yuhansol/.npm/_logs/2022-01-24T00_26_59_329Z-debug-0.log
24 timing npm:load:logFile Completed in 3ms
25 timing npm:load:timers Completed in 0ms
26 timing npm:load:configScope Completed in 0ms
27 timing npm:load Completed in 15ms
28 silly logfile start cleaning logs, removing 1 files
29 http fetch GET 200 https://registry.npmjs.org/commitlint 827ms (cache revalidated)
30 timing arborist:ctor Completed in 1ms
31 timing arborist:ctor Completed in 0ms
32 timing command:exec Completed in 856ms
33 verbose stack Error: canceled
33 verbose stack     at exec (/opt/homebrew/lib/node_modules/npm/node_modules/libnpmexec/lib/index.js:154:17)
33 verbose stack     at async module.exports (/opt/homebrew/lib/node_modules/npm/lib/cli.js:66:5)
34 verbose cwd /Users/yuhansol/workspace/brandi-ai-cms-react
35 verbose Darwin 21.2.0
36 verbose argv "/Users/yuhansol/.nvm/versions/node/v16.13.0/bin/node" "/opt/homebrew/lib/node_modules/npm/bin/npm-cli.js" "exec" "--no-yes" "--" "commitlint" "--edit" ""
37 verbose node v16.13.0
38 verbose npm  v8.3.0
39 error canceled
40 verbose exit 1
41 timing npm Completed in 1076ms
42 verbose code 1
43 error A complete log of this run can be found in:
43 error     /Users/yuhansol/.npm/_logs/2022-01-24T00_26_59_329Z-debug-0.log

Current Behavior

Affected packages

  • cli
  • core
  • prompt
  • config-angular

Possible Solution

Steps to Reproduce (for bugs)

  1. First step: Set yarn version berry(v3)
  2. Second step: git commit

Context

Your Environment

Executable Version
commitlint --version 16.1.0
git --version 2.32.0 (Apple Git-132)
node --version 16.13.0

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6

github_iconTop GitHub Comments

3reactions
yuhs0commented, Mar 2, 2022

Now this is solved. This is absolutely my fault. I’m sorry to everyone.

Before my .husky/commit-msg file.

#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx --no -- commitlint --edit ""

After yarn v3 can’t use npx command. And wrong command --no -- commitlint --edit ""

So I modify it.

#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn dlx commitlint --edit $1
0reactions
escapedcatcommented, Mar 3, 2022

👏 Great you figured it out!
You think we should update the README here to show how it works with yarn v3?

Read more comments on GitHub >

github_iconTop Results From Across the Web

@commitlint/config-conventional | Yarn - Package Manager
Shareable commitlint config enforcing conventional commits. Use with @commitlint/cli and @commitlint/prompt-cli. Getting started. npm install --save-dev @ ...
Read more >
lint-staged not running on precommit - Stack Overflow
yarn add -D husky npm set-script prepare "husky install" && yarn ... I ran "npx mrm lint-staged" like the official website says but...
Read more >
how to install express in console Code Example
npm init -y npm i express. ... setup node js express basic setup ... could not find expected browser (chrome) locally. run npm...
Read more >
7zip-bin-osx 5.1.1 : MIT License @auth0/auth0-react 1.2.0
@commitlint/types 12.1.4 : MIT License ... @npmcli/map-workspaces 1.0.3 : ISC License ... @npmcli/run-script 1.8.5 : ISC License.
Read more >
mmb.irbbarcelona.org/gitlab/aluciani/MoDEL-CNS_cli...
-**It is not required for React** but many people enjoy it (and React Native uses a ... -3. Run `npm run flow init`...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found