Skip to content

ng add gives errors with a before parameter in the .npmrc file #24685

Closed

Description

@cherezovvv

Command

add

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

For before parameter in npm config, value is of type string, for example before = 2023-02-09T08:45:22.778Z.
packument function of pacote package, expects before as js Date type.
It seems to me that it is necessary to add a date type conversion in the normalizeOptions function in packages/angular/cli/src/utilities/package-metadata.ts

Minimal Reproduction

  1. Add before parameter to npm config (.npmrc file) - before = 2023-02-09T08:45:22.778Z
  2. Run script ng add @angular/material

Exception or Error

`Unable to load package information from registry: this.before.toISOString is not a function`

Your Environment

Angular CLI: 13.2.5
Node: 16.14.0
Package Manager: npm 8.3.1
OS: linux x64
Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1302.5
@angular-devkit/build-angular   13.2.5
@angular-devkit/core            13.2.5
@angular-devkit/schematics      13.2.5
@angular/cli                    13.2.5
@schematics/angular             13.2.5
rxjs                            7.5.4
typescript                      4.5.5

Anything else relevant?

No response

Activity

  1. added a commit that references this issue on Feb 9, 2023
    5e2c158
  2. added 2 commits that reference this issue on Feb 10, 2023
    545c180
    df07ab1
  3. angular-automatic-lock-bot commented on Mar 13, 2023

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  4. locked and limited conversation to collaborators on Mar 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions