-
Notifications
You must be signed in to change notification settings - Fork 601
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
[rush] Let's get NPM 6 working with Rush #886
Comments
Sure! @zkat this would be the absolute most valuable issue for NPM to help us out with:
I can provide an isolated repro if needed. But the basic idea is that when we do this... package.json {
"name": "rush-common",
"description": "Temporary file generated by the Rush tool",
"private": true,
"version": "0.0.0",
"dependencies": {
"@rush-temp/app1": "file:./projects/app1.tgz"
}
} ...after
Anything less than that, and NPM continues to install the old tarball from the cache, ignoring our updates. This more or less was working in NPM 4, but repros in both NPM 5 and NPM 6. |
When I tried workaround #2 again just now with the latest NPM 6.4.1, it's crashing with this call stack:
If I also delete package-lock.json then this error goes away. |
I also ran into that during my investigations. For me, I think that it was caused by NPM 6 encountering a package-lock.json generated by NPM 5. I had to delete npm-shrinkwrap.json to get past it. |
In this case the package-lock.json was created by the same version of NPM. (This was an isolated manual repro, not a real Rush installation.) |
hey, y'all! I'd love to help out here with any questions y'all have (though I've got pretty low availability lately). One thing to note: npm is moving away from I'll also note that I don't believe anything having issues with I'm curious what the |
That's really great! It should really improve reliability of NPM under heavy usage. @zkat what about the |
That's fine. The issues I called out at the top of this issue all affect the latest NPM. If we can get the latest NPM working, that should be sufficient for most people's needs. |
In the meantime, is it best practice to use PNPM? Thanks! |
We don't really recommend one of the package managers as being "best". The decision depends on your needs. But I believe the Rush docs call out some non-subjective considerations:
Fortunately, switching package managers is pretty easy with Rush, and |
I'm experiencing this error while using my company's proxy (while using proper syntax like |
Status update: NPM recently announced that version 7 will finally provide support for monorepos. Today, the monorepo support implemented by Yarn and PNPM is already reasonably close to what we do in One downside is that NPM and Yarn classic will lose Rush's protection against phantom dependencies. But we've found that users with complex installs inevitably move to PNPM or Yarn Plug'n'Play anyway. But an upside is that you would be able to use the package manager's monorepo commands in your Rush repo. |
Awesome direction, @octogonz. Do you have another tracking issue on this? Would love see more details on what it would mean to have workspaces support with rush |
I have 2 projects one with vue-cli and one with webpack.
and etc I spent a lot of time to earn at least something, but nothing worked. |
NPM was my last hope and I left it here |
@NikitaIT Could you share a repro of your build that failed using PNPM? I've heard from several people that If you could share a PNPM repro, I'd be willing to debug it, determine whether the problem is really Vue, and if so open a proper issue to help get this solved. As stated above, Rush does have plans this fall to enable NPM/Yarn to use their conventional ("shamefully flatten") installation strategy, which should solve your problem. But that's not a scalable way of installing packages (due the phantom/doppelganger concerns), so this "fix" wouldn't help larger monorepos that really do need a PNPM or Yarn Plug'n'Play installation strategy. |
@octogonz
Init only:
Symbolic Links in node_modules(Troubleshooting):
|
BTW I've opened this issue to track the feature to enable Rush to use the package manager's monorepo support (workspaces): #1553 |
Hey @octogonz has any progress been made on this? |
It's next in the queue in our roadmap. |
Any movement on this? I am getting some serious npm errors in my pipeline due to corrupted package.tgz files. I am hoping this fixes that issue. |
Ok, if NPM 5 and 6 are no good, how about NPM 7 and 8? Really surprised to see the docs so far behind on this issue. And this issue hasn't been updated in 2+ years. Feel like I am missing something rather obvious? |
any updates on this? I plan to move from yarn because of this issue and pnpm is not possible, since it breaks some build on my apps |
@fahmifan - We encountered a number of issues with NPM over the years, so supporting it hasn't been a priority. We'd happily take a PR to update support for NPM, but our team likely won't put that together ourselves. What issues are you hitting with pnpm? |
Today the important differences are not the package manager itself, but rather the underlying installation model. The Lockfile Explorer docs summarize the reasons why NPM's installation model is not a good tech bet for a monorepo, regardless of whether you are using Yarn Classic or NPM.
From my experience, there is almost always a way to get PNPM working, and although it can be nontrivial work, it generally turns out to be less work than other approaches such as trying to run your monorepo with Yarn or NPM. The method for fixing PNPM incompatibilities generally involves |
@iclanton I have issue when running our FE app built with
I think maybe it's caused by babel-loader, so I tried |
I have been moving all my packages in a monorepo with rush and pnpm for some months with great success.
|
👋 This issue mentions npm 6, but we are currently (as of Node.js 20) on npm 10. Is this still an issue, or something that was missed in a prioritization/close cycle? |
Yes, we should probably close this ticket. NPM's installation model is not a good fit for large code bases, and the compatibility issues with PNPM are now fully solved, so it is very hard to find anyone willing to work on NPM support for Rush. You can find some background here: |
@octogonz - you want to just go ahead and close this issue? Maybe before we close this we should add a feature to Rush test prints an explanation for our minimal support for NPM. |
Just wondering how many users are using Rush with npm? |
I am bumming out with NX and my svelte-kit project and was investigating rush. I use a windows machine and npm 10!! with node 20. my workspace would be pretty small. the svelte-kit app and another node app or 2 and 5 node libraries. should i upskill to pnpm? my early reading has me under the impression that rush uses its own pnpm under the hood. so is my package manager even germane? |
Rush shouldn't be in a position of recommending that people use the ancient NPM 4. Due to recent interest, I am opening this meta-issue to track the punch list of work items needed to get the latest NPM version to be supported by Rush.
Off the top of my head:
"file:"
version specifiers (See [rush] NPM 5.x or newer ignores changes for Rush's "file:" version specifiers #708 (comment)). For now, Rush should wipe NPM's entire (local) cache on every install. Later we'll improve this by deleting only the@rush-temp
entries, or (ideally) by getting NPM to fix the root cause.npm shrinkwrap
command, because in NPM 5.x it corrupts the shrinkwrap file. (NPM 4.x and NPM 6.x seem to be okay)The text was updated successfully, but these errors were encountered: