nathanhleung / install-peerdeps

💻 A command-line interface to install an NPM package and its peer dependencies automatically.
https://www.npmjs.com/package/install-peerdeps
MIT License
296 stars 20 forks source link

install-peerdeps `ERR undefined` on windows #228

Open Eprince-hub opened 2 years ago

Eprince-hub commented 2 years ago

Installing ESLint configs using install-peerdeps fails on windows 10/11 Running the code below produces the error as seen in the screenshot

npx install-peerdeps@latest --yarn --dev @upleveled/eslint-config-upleveled

install-peerdeps-error

OS: Windows 10 and also tested on windows 11 Node Version: 18 CLI: Hyper

Steps to reproduce Failing project reproduced in this repo

clone Project

git clone https://github.com/Eprince-hub/reproduce-install-peerdeps-error.git

cd into project

cd reproduce-install-peerdeps-error

install all dependencies

yarn

run Upleveled ESLint config

npx install-peerdeps@latest --yarn --dev @upleveled/eslint-config-upleveled

Things I have tried Running the config with a specific install-peerdeps version Running the config with no version number Downgrading nodejs None seems to have helped

wesbos commented 2 years ago

also hitting this, I found deleting my package-lock.json file fixed it. Not sure why I was hitting it

karlhorky commented 2 years ago

After seeing this error numerous times from different students in the bootcamp, it appears that this ERR undefined will happen if there is any error associated with the underlying command.

So, what I understand is:

  1. This is actually not the real error message, it is obscuring the real error message
  2. It doesn't have to do with some particular error - it happens with all errors (gut feel says it's probably related to accessing some undefined property internally in install-peerdeps@3)
  3. This does not happen in install-peerdeps@2
karlhorky commented 2 years ago

Seems like adding Windows tests (#127) would be a good way to verify the fix and prevent regressions in the future.

karlhorky commented 2 years ago

We instead removed install-peerdeps and moved to a simpler custom script in our ESLint config: https://github.com/upleveled/eslint-config-upleveled/compare/v2.19.0...v3.0.0

leandrocunha commented 2 years ago

Same error with me trying to use with my private repo. The solution to display the real error was to use v2 as mentioned above by @karlhorky

npx install-peerdeps@2 --dev <package-name>
install-peerdeps v2.0.3
ERR That package doesn't exist. Did you mean to specify a custom registry?
cong1223 commented 11 months ago

我尝试与我的私人仓库一起使用时出现同样的错误。显示真实错误的解决方案是使用上面提到的 v2@karlhorky

npx install-peerdeps@2 --dev <package-name>
install-peerdeps v2.0.3
ERR That package doesn't exist. Did you mean to specify a custom registry?

thx, same issue, how can i specify registry?