Skip to content

[BUG] npx doesn't pass $1 properly to executed package on Linux/Darwin #3067

Closed
npm/run-script
#78
@bk201-

Description

@bk201-

Current Behavior:

Executing this script passes to the husky wrong argument, but it properly worked at npm@6

npx husky add .husky/commit-msg 'npx --no-install commitlint --edit "$1"'

The result is:

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

Expected Behavior:

The result is:

npx --no-install commitlint --edit "$1"

Steps To Reproduce:

  1. Created a new folder
  2. git init
  3. npm init
  4. npm install husky -D
  5. npm set-script prepare "husky install"
  6. npm run prepare
  7. npx husky add .husky/prepare-commit-msg 'npx --no-install jira-prepare-commit-msg "$1"'

I made some research here

Environment:

  • Ubuntu 20.04
  • Node: 15.3.1
  • npm: 7.9.0

Metadata

Metadata

Assignees

Labels

Bugthing that needs fixingPriority 2secondary priority issueRelease 7.xwork is associated with a specific npm 7 release

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions