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
[ENHANCEMENT] Use npm 3 #6306
[ENHANCEMENT] Use npm 3 #6306
Conversation
Have reviewed, LFantasticTM. I was worried we'd have to do another one of these. Considering this will likely have some surprising and weird side effects for a few of our end users I'll write a little blurb for the changelog for the first time this is released (2.10.0-beta.1). @ember-cli/core I'd love for everybody to weigh in on possible concerns for shifting to npm3 over the next day so that we make sure we address all the things in time for the 2.10 release. @kategengler you come to mind in particular... |
talk about elegant... 💯 |
I've just tried this and it seems to work well. The UI while installing has changed though since the NPM output comes through now and is no longer silent. Also while bower installing I was seeing some NPM output which was a bit confusing. |
@nathanhammond Because of ember-try? Should be fine. |
@Turbo87 I can look into silencing the npm output during installation, if that's desirable. I actually really liked having the details about how far along the installation process was (much better than npm@2's Based on npm/npm#11283, it looks like a nonzero but < 5% perf impact, which is consistent with my totally-unscientific testing:
|
yeah, I'm fine with having the output, we should just make sure not to leak npm output into the bower install step |
they should happen in serial, so there should be no leak. |
thanks for digging into this, the upgrade issues left me perplexed. I am glad you were able to get to the bottom of it. |
in theory yes, but that's what I saw happening with the console output... |
@Turbo87 I looked into it a little further — This seems like a bug in npm to me, but I can imagine workarounds on this end. Thoughts? |
yup sounds reasonable. |
@dfreeman I think I'd file a bug at npmlog instead of into the 2343 open issues at NPM. Would you be willing to do that? I don't personally care enough on our side to make this perfect since it works just fine but I'd like to at least catalog it for them. |
@nathanhammond It's not totally clear to me where the fix will need to happen — I haven't fully wrapped my head around the interplay between I'll file on |
Following back up on the logging leakage, it looks like npm essentially just always has a progress meter going while it's running (it gets turned on when we call Since the only officially-supported way to invoke the install command is via the npm CLI, they just let the process exit clean up the running progress bar rather than explicitly disabling it. I don't know the full history behind why npm is executed the way it is from this end, but if
|
The "only use |
I was prepared for this to be a lot more painful, but it turns out the only thing breaking the test suite with npm 3 was transitive dependency resolution in the cached
.node_modules-tmp
directory.Since v3 flattens dependencies where possible, where we'd have
.node_modules-tmp/pkg-a/node_modules/pkg-b
before, now we get.node_modules-tmp/{pkg-a,pkg-b}
. Node will only resolve arequire
from one package to its peer when they're both in a directory called "node_modules", sorequire('pkg-b')
would fail frompkg-a
.The change here is just to nest the shared directory so that it can be called
node_modules
and then node's resolution process will do the right thing.