Skip to content

[BUG] dev true is flaky #6521

Open
Open

Description

@robertIsaac

Is there an existing issue for this?

  • I have searched the existing issues

This issue exists in the latest npm version

  • I am using the latest npm

Current Behavior

when there is same dependency marked as both devDependency and a dependency at the same time, the package-lock.json start become flaky, sometimes it list it with dev: true and some other times it doesn't
which causes conflicts in our repo, because of incorrect changes were made

Expected Behavior

if a package is both dependency and devDependency, not to be marked as "dev": true in the package-lock.json

Steps To Reproduce

  1. generate new nx angular project npx create-nx-workspace
  2. choose angular, then nothing matter, but to be thoroughly I choose these answers standalone, css, yes, no, no`
  3. run npm i multiple times and check after each time if package-lock.json file changed

the cause of the error is @nx/angular see nrwl/nx#6885
it's installed as production dependency instead of dev dependency
you can see here https://github.com/nrwl/nx/blob/master/packages/angular/package.json it has a lot of what normally are dev dependencies as direct dependencies or peer dependencies, very obvious examples are @nx/linter and @nx/jest which are installed as a dev dependencies in the project root package.json

Environment

  • npm: 9.6.7
  • Node.js: v18.16.0
  • OS Name: Windows 11
  • npm config:
; "user" config from C:\Users\rober\.npmrc

script-shell = "C:\\Users\\rober\\AppData\\Local\\Microsoft\\WindowsApps\\Microsoft.PowerShell_8wekyb3d8bbwe\\pwsh.exe"

; node bin location = C:\Program Files\nodejs\node.exe
; node version = v18.16.0
; npm local prefix = C:\Users\rober\WebstormProjects\daemon-process-terminated-reprod
; npm version = 9.6.7
; cwd = C:\Users\rober\WebstormProjects\daemon-process-terminated-reprod\src\app
; HOME = C:\Users\rober

Activity

  1. added
    Bugthing that needs fixing
    Needs Triageneeds review for next steps
    Release 9.xwork is associated with a specific npm 9 release
    on Jun 2, 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

    Labels

    Bugthing that needs fixingNeeds Triageneeds review for next stepsRelease 9.xwork is associated with a specific npm 9 release

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions