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

Error installing a dependency package that already exists #678

Closed
psckeithw opened this issue Jan 10, 2020 · 0 comments
Closed

Error installing a dependency package that already exists #678

psckeithw opened this issue Jan 10, 2020 · 0 comments

Comments

@psckeithw
Copy link

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.")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants