-
Notifications
You must be signed in to change notification settings - Fork 598
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] rush install
fails with npm@5
#394
Comments
Got the same error today. EDIT: just found this, maybe it will help: September 5, 2017 - Changes requiring action in Rush 3.0.15 Rush 3.0.15 changes some behavior in the temp modules folder to be compatible with NPM 5 and PNPM. You will likely see the following error during installation: ERROR: Failed to parse package.json for : Invalid version: "file:projects/.tgz" |
@nickpape-msft This issue was raised 2 weeks ago and earlier in #354, can you please lend us a hand? Considering we have a scripted workaround, I'm happy to contribute the code change back to Rush if you could just point me in the right direction. On Node 8.7.0 with NPM 5.4.2 (and all other versions of npm 5.x that we've used), the problem has been deterministic and repeatable for every member of my team. This was a total blocker for us so I figured out a hacky solution that lets us move forward. Before committing the
Can someone from the Rush team pls point me to where this code change should go in the underlying Rush lib? |
@HipsterZipster Yes, it's working! |
@HipsterZipster I confirmed too. It works! |
Hey guys, sorry about the slow response. I will investigate this morning. FYI we tried upgrading to NPM 5 several times for our internal repos, but each time we had to rollback because of regressions in the NPM tool. We got really frustrated by this and have been experimenting with migrating to PNPM instead of NPM. It is a drop-in replacement that introduces a fundamentally different node_modules directory structure that makes the Rush symlinking algorithm much simpler, and should make installs a lot faster. The PR is here if you're interested. (We also looked at Yarn, but it's the same old crazy design as NPM, just with a much more solid implementation.) Anyway if NPM 5 finally has a usable release, we should make sure it works. |
Update: This seems to be a bug in read-package-tree which is how "rush link" scans the node_modules folder. That library is part of NPM itself, but even when I upgrade to the version used by NPM 5, it still cannot read a folder containing tgz references. (Even though "npm install" and "npm shrinkwrap" are totally cool with these references.) It seems to be due to some difference in the package.json files emitted by NPM. I'm trying to pin down what has changed exactly. But I suspect the fix will be in read-package-tree not Rush. |
Actually it's looking like this is yet another NPM 5 regression: Rush generates a common/temp/package.json that does this: "dependencies": {
"yargs": "~4.6.0",
"z-schema": "~3.18.3",
"@rush-temp/api-documenter": "file:./projects/api-documenter.tgz", ...and then our common/temp/projects/api-documenter.tgz contains a package.json like this: {
"name": "@rush-temp/api-documenter",
"version": "0.0.0",
"private": true,
"dependencies": { ...but then NPM 5 installs a common/temp/node_modules/@ rush-temp/api-documenter/package.json that wrongly has this: "version": "file:projects/api-documenter.tgz" ...whereas under NPM 4 it looked like this: "version": "0.0.0" [redacted for diplomatic reasons heheh] |
I started a conversation with NPM to see if they can fix this. |
Thank you @pgonzal for your attention to this and for uncovering the underlying issue within NPM. I assume this regression from the Rush perspective is an effect of the new I agree it'd be amazing if NPM5 upped its game and removed the regressions, especially for big firms that block Yarn registry and invest in their own npm registries and license filtering solutions. pnpm looks like an interesting option, but may not be an option for for many corporate users since it uses hard links, which require admin permissions on Windows. grrrr 👎 EDIT: |
I was able to isolate a simple repro. I've opened NPM issue 19006. In the meantime we'll see if we can come up with a better workaround. @nickpape-msft FYI |
Rush 4 has been published. :-) |
@pgonzal Thank you! |
Hi,
Does not Rush support npm@5 yet?
Using npm@5,
rush install
results in the error whencommon/temp
directory does not exist.(The same error as #354)
This becomes a problem when I run
rush install
for a cloned repository.Usually
common/temp
does not be committed sorush install
for a cloned repository always fail.Reproduction steps:
rush.json
rush generate
rush install
succeeds at this time)common/temp
rush install
ERROR: Failed to parse package.json for ...
I confirmed this error does not occur with [email protected].
environment:
The text was updated successfully, but these errors were encountered: