Skip to content

[BUG] process.env.npm_config_user_agent missing in v7 #2960

@alexander-mai

Description

@alexander-mai

Current Behavior:

npm i --save-dev husky doesn't run the install and postinstall scripts after installing the package so the git hooks are never setup.
The reason is the missing environt variable npm_config_user_agent

Expected Behavior:

The env var npm_config_user_agent is set.
The variable is set on npm version 7.6.3.

Steps To Reproduce:

npm i --save-dev husky
See the error message

husky > Setting up git hooks
Cannot destructure property `name` of 'undefined' or 'null'.
husky > Failed to install

Environment:

  • OS: MacOS 11.2.3
  • Node: 10.24.0
  • npm: v7.7.2

Metadata

Metadata

Assignees

Labels

Bugthing that needs fixingRelease 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