Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Error installing a dependency package that already exists #678

@psckeithw

Description

@psckeithw

When
Everytime Node.js version 10.8.x is run

Where
From cmd line

Current Behavior
The root cause of this issue is that with Node.js version 10.18.x NPM has been upgraded from 6.11.3 to 6.13.4.
This new NPM version errors when installing a dependency package that has already been installed. The message reports to either remove all existing node_modules or use the [-f | --force] switch.
Previously there was no error reported from 6.11.3 and the installation was either skipped (as it was previously installed), overwritten, or installed component based vs global. Unfortunately this breaks our current build script because an error output from the NPM installation cancels the build of the index.js file.
Resulting Error: File not found: '.../index.js'

Steps to Reproduce
Open terminal and run npm to compile TypeScript

Expected Behavior
index.ts is compiled into index.js

Root Cause
Node.js version 10.18.x NPM has been upgraded from 6.11.3 to 6.13.4.
This new NPM version errors when installing a dependency package that has already been installed. The message reports to either remove all existing node_modules or use the [-f | --force] switch.
Previously there was no error reported from 6.11.3 and the installation was either skipped (as it was previously installed), overwritten, or installed component based vs global. Unfortunately this breaks our current build script because an error output from the NPM installation cancels the build of the index.js file.

A couple of workarounds are available but I would like to know if there are other options or when this could be resolved.

  1. Use Node.js 10.17.x instead thereby using NPM version 6.11.3 where the behavior is as expected
  2. Update the build.ts file to include the --force parameter during the installation to force the installation of child dependencies (Please Note: This will result in the following warning for every compiled task "[WARN] NPM: npm WARN using --force I sure hope you know what you are doing.")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions