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

Version bump causes issues after updating to npm8 workspaces #500

Closed
mofojed opened this issue Mar 25, 2022 · 1 comment · Fixed by #501
Closed

Version bump causes issues after updating to npm8 workspaces #500

mofojed opened this issue Mar 25, 2022 · 1 comment · Fixed by #501
Assignees
Labels
bug Something isn't working
Milestone

Comments

@mofojed
Copy link
Member

mofojed commented Mar 25, 2022

Description

After updating to npm 8 workspaces, npm version-bump isn't working correctly...

Steps to reproduce

  1. Run npm run version-bump, and update a patch version. Commit the change (don't push it)
  2. rm -rf node_modules
  3. npm install

Expected results
3. npm install succeeds

Actual results
3. npm install fails with an error:

➜  main git:(web-v0.11.4) npm install
npm ERR! code ETARGET
npm ERR! notarget No matching version found for @deephaven/iris-grid@^0.11.4.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/bender/.npm/_logs/2022-03-25T21_54_06_342Z-debug-0.log

Additional details and attachments
It looks like the problem is because package-lock.json isn't updating??? There is a weird way to workaround this issue:

  1. After deleting node_modules, In package.json, apply the following diff:
diff --git a/package.json b/package.json
index 08a17deab6..fe8016a680 100644
--- a/package.json
+++ b/package.json
@@ -3,14 +3,13 @@
   "private": true,
   "version": "0.0.1",
   "workspaces": [
-    "./packages/*"
+    "./packages/tsconfig"
   ],
   "engines": {
     "node": ">=16",
     "npm": ">=8"
   },
   "scripts": {
-    "postinstall": "run-s build:necessary",
     "clean:build": "rimraf packages/*/dist",
     "postclean:build": "npm run clean:types",
     "clean:cache": "run-s clean:cache:*",
  1. Run npm install
  2. After running npm install, package-lock.json will be updated. Revert the change to package.json, then run npm install again. It should now work correctly after deleting node_modules again.
@mofojed mofojed added bug Something isn't working triage Issue requires triage labels Mar 25, 2022
@mofojed mofojed self-assigned this Mar 28, 2022
@mofojed mofojed added this to the March 2022 milestone Mar 28, 2022
@mofojed mofojed removed the triage Issue requires triage label Mar 28, 2022
@mofojed
Copy link
Member Author

mofojed commented Mar 28, 2022

There seems to be a couple of lerna issues about this, with a couple of recommended fixes:
lerna/lerna#2891
lerna/lerna#2832
In the docs they do mention converting links, so we'll try that to fix the issue: https://github.com/lerna/lerna/blob/6cb8ab2d4af7ce25c812e8fb05cd04650105705f/README.md#common-devdependencies

On another note, we may want to look at Rush again. Lerna hasn't been updated in a while: lerna/lerna#1679 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant