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 when installing new versions using pnpm #1191

Closed
3 tasks done
andrei-zgirvaci opened this issue Sep 17, 2022 · 7 comments
Closed
3 tasks done

Error when installing new versions using pnpm #1191

andrei-zgirvaci opened this issue Sep 17, 2022 · 7 comments

Comments

@andrei-zgirvaci
Copy link

  • I have searched for similar issues
  • I am using the latest version of npm-check-updates
  • I am using node >= 14

Steps to Reproduce

.ncurc:

Dependencies:

Steps:

  1. Run: ncu --upgrade --interactive --format group
  2. Select packages (doesn't matter which or how many)
  3. When asked if you would like to install new versions using pnpm, type Yes

Current Behavior

An error is thrown:

/Users/andrei/Library/pnpm/global/5/.pnpm/npm-check-updates@16.1.2/node_modules/npm-check-updates/build/src/index.js:57
    throw err;
    ^

Expected Behavior

No errors should be thrown

Thank you in advance for the help on this matter as I am curious if my pnpm has some issues or if it's something else!

@raineorshine
Copy link
Owner

It works as expected for me:

raine[1191]% cat package.json
{
  "dependencies": {
    "ncu-test-v2": "1.0.0"
  }
}
raine[1191]% ncu --upgrade --interactive --format group
Upgrading /Users/raine/projects/ncu-issues/1191/package.json
[====================] 1/1 100%

✔ Choose which packages to update ›

 ncu-test-v2  1.0.0  →  2.0.0

✔ Run pnpm install to install new versions? … yes

git diff:

diff --git a/package.json b/package.json
index 84c652e..a3a9f05 100644
--- a/package.json
+++ b/package.json
@@ -9,6 +9,6 @@
   },
   "license": "ISC",
   "dependencies": {
-    "ncu-test-v2": "1.0.0"
+    "ncu-test-v2": "2.0.0"
   }
 }
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 89485a7..e0ce226 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -1,13 +1,13 @@
 lockfileVersion: 5.4

 specifiers:
-  ncu-test-v2: 1.0.0
+  ncu-test-v2: 2.0.0

 dependencies:
-  ncu-test-v2: 1.0.0
+  ncu-test-v2: 2.0.0

 packages:

-  /ncu-test-v2/1.0.0:
-    resolution: {integrity: sha512-Oaw47teUXoN1tzTj8h+q1NiMlRRJeG9cs2EyPkITLogRcsoe3Z/QiTc7dgZdXh8Pm4TL0VhvGz0hnqsR20XFWw==}
+  /ncu-test-v2/2.0.0:
+    resolution: {integrity: sha512-Jqu6DzpKkTrUdeL+VN/X4lz4IVDxkNAqVHmyJ+3uVcszqPlU8JMNTA2qeihzMcbd4pOiagKlJno7r+EO2WLmfw==}
     dev: false

@andrei-zgirvaci
Copy link
Author

andrei-zgirvaci commented Sep 20, 2022

@raineorshine sorry, forgot to mention.

Indeed the package.json, pnpm-lock.yaml and node_modules does get updated, but and error is thrown after.

The error doesn't screw anything up, it's just annoying to see it every time and I am curious if other people have it too...

@raineorshine
Copy link
Owner

I'm not seeing any error on my side when I run the command as described. Without being able to reproduce it there's not much I can do, but maybe somebody who can reproduce it is able to investigate.

@leosuncin
Copy link

Reproduction:
asciicast

Repository: https://github.com/leosuncin/nest-api-example

@leosuncin
Copy link

And it gets worst with --doctor

npm-check-updates --upgrade --doctor

ncu -u --doctor

npm-check-updates --upgrade --doctor --doctorTest='pnpm test' --doctorInstall='pnpm install'

ncu -u --doctor --doctorTest='pnpm test' --doctorInstall='pnpm install'

@raineorshine
Copy link
Owner

raineorshine commented Sep 28, 2022

Thanks for the repo. I was able to reproduce the issue.

I found that pnpm was silently failing with ERR_PNPM_PEER_DEP_ISSUES Unmet peer dependencies. Actually, if pnpm install is run manually in the terminal from the same starting point. the same error occurs. It just gets resolved the second time pnpm install is run (presumably once webpack is installed).

It may occur in pnpm install itself, but is still a pain, so I disabled strict-peer-dependencies when run within npm-check-updates. This fixed the issue for me.

The reason the error was not printed out is that pnpm incorrectly writes it to stdout instead of stderr. I opened an issue here: pnpm/pnpm#5419. I also updated npm-check-updates to print stdout if stderr is empty. Now you should at least be able to see the exact error message if pnpm install fails.

Published in npm-check-updates v16.3.3

@raineorshine
Copy link
Owner

raineorshine commented Sep 28, 2022

And it gets worst with --doctor

Please open a separate issue with steps to reproduce if the error with --doctor still occurs after upgrading to v16.3.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants