12

I had node version 10 installed in my system, after upgrading my npm from version 6 to version 7 I couldn't install the dependencies, and I'm getting error so I had to downgrade my node to 6, (both npm ci and npm i was failing) And the project I was testing is this:

https://github.com/Giveth/feathers-giveth

the errors were something like this:

npm ERR! code 128
npm ERR! git dep preparation failed
npm ERR! command /Users/username/.nvm/versions/node/v10.23.0/bin/node /Users/username/.nvm/versions/node/v10.23.0/lib/node_modules/npm/bin/npm-cli.js install --force --cache=/Users/username/.npm/_cacache --prefer-offline=false --prefer-online=false --offline=false --no-progress --no-save --no-audit
npm ERR! npm WARN using --force Recommended protections disabled.
npm ERR! npm ERR! code 128
npm ERR! npm ERR! command failed
npm ERR! npm ERR! command git clone --mirror -q ssh://git@github.com/gulpjs/gulp.git /Users/renjer/.npm/_cacache/_cacache/tmp/git-clone-dfb83c15/.git
npm ERR! npm ERR! fatal: destination path '/Users/username/.npm/_cacache/_cacache/tmp/git-clone-dfb83c15/.git' already exists and is not an empty directory.
npm ERR!
npm ERR! npm ERR! A complete log of this run can be found in:
npm ERR! npm ERR!     /Users/username/.npm/_cacache/_logs/2021-02-18T16_18_35_855Z-debug.log

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/username/.npm/_logs/2021-02-18T16_20_15_536Z-debug.log
Mohammad Ranjbar Z
  • 1,487
  • 1
  • 10
  • 20

1 Answers1

1

This problem usually happen because if you only upgrade the node version of the system, there are some packages and dependencies that are installed according to that version.

This is a manual process, but you have to install the package according that version.

For example (package.json): In your node 6 version you have some package:

"xyz":^1.2.3

that package was installed and its dependencies to work with node 6 delete manually that package from your package.json and install it manually like

npm install xyz

Then is possible that you notice an upgrade to the version, something like:

"xyz":^4.5.6

Do that for everyone of your packages and probably your problem disappears. That's the way that I have used to solve that problem.

You can also upgrade all the packages to its lasts version but ... if you have many packages and someone is not working you are not going to know which one is failing, and you are going to check it individually.

Maybe (at the moment of writing this answer) if you are using Node 10, the latest package's version is not going to work either because that version could be fixed to work with Node 16 (the LTS (Long term support) version at the moment of writing this answer).

If you haven't done that yet, I suggest to continually upgrade your system to the some LTS version that isn't deprecated.

Samuel Urias
  • 92
  • 1
  • 3