tomdale / ember-cli-addon-tests

31 stars 18 forks source link

Npm (5) install will override the symlinked addon under test #176

Open simonihmig opened 6 years ago

simonihmig commented 6 years ago

Not a bug here, but in npm itself: https://github.com/npm/npm/issues/17287

Lost quite some time because of this, so mentioning this here in case others get bitten by this. ember-cli-addon-tests will symlink the addon under test into node_modules of the temporary app, but if you call npm install afterwards (e.g. by calling app.run('npm', 'install')), npm 5 will remove the symlink and install the addon from the npm registry (which is probably not the same code that you are working on). Does not happen with npm 3.

kellyselden commented 6 years ago

All I have to say is WTF.

mansona commented 6 years ago

Ok so I've done some investigation into this and I don't really know how to proceed. The main issue is that the link needs to be the last thing that is done after all npm install steps.

@simonihmig you are right saying this is a known issue in npm but the main issue is this one https://github.com/npm/npm/issues/10343 which is tagged with big-bug so it's unlikely that we'll get an "out of the box" fix any time soon, although I happen to know that npm@6 had an internal refactoring that was specifically designed to address issues like this.

I will create a PR to show my work so far, although it is specifically related to https://github.com/kaliber5/ember-fastboot-addon-tests/issues/21