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

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

Closed
1 task
cherezovvv opened this issue Feb 9, 2023 · 1 comment · Fixed by #24687
Closed
1 task

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

cherezovvv opened this issue Feb 9, 2023 · 1 comment · Fixed by #24687
Labels
area: @angular/cli freq1: low Only reported by a handful of users who observe it rarely severity3: broken

Comments

@cherezovvv
Copy link

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

@alan-agius4 alan-agius4 added freq1: low Only reported by a handful of users who observe it rarely severity3: broken area: @angular/cli labels Feb 9, 2023
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Feb 9, 2023
Previously, the `before` option in the npmrc was not converted properly to a date.

See: https://docs.npmjs.com/cli/v8/using-npm/config#before

Closes angular#24685
angular-robot bot pushed a commit that referenced this issue Feb 10, 2023
Previously, the `before` option in the npmrc was not converted properly to a date.

See: https://docs.npmjs.com/cli/v8/using-npm/config#before

Closes #24685
angular-robot bot pushed a commit that referenced this issue Feb 10, 2023
Previously, the `before` option in the npmrc was not converted properly to a date.

See: https://docs.npmjs.com/cli/v8/using-npm/config#before

Closes #24685

(cherry picked from commit 545c180)
@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Mar 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: @angular/cli freq1: low Only reported by a handful of users who observe it rarely severity3: broken
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants