ember-cli-addon-tests icon indicating copy to clipboard operation
ember-cli-addon-tests copied to clipboard

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

Open simonihmig opened this issue 7 years ago • 2 comments
trafficstars

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.

simonihmig avatar Jan 02 '18 11:01 simonihmig

All I have to say is WTF.

kellyselden avatar Jan 15 '18 05:01 kellyselden

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

mansona avatar May 14 '18 22:05 mansona