Closed alisianoi closed 8 years ago
According to https://docs.npmjs.com/misc/scripts the uninstall script should do what we expect.
I looked for open npm issues, this is the only one I've found: https://github.com/npm/npm/issues/10379 - its not about uninstalling, but since npm 3.x changed the behaviour of preinstall, maybe it also messed up uninstall.
If we can be sure that it is an npm issue, we should create a reduced test case (not involving commitplease) and file an issue against npm. Then document the manual workaround, since we can't expect this to get fixed anytime soon.
It does not remove the hook though.
Any idea why? What's the output?
Any idea why? What's the output?
It's the backticks. Now with npm --version
at 2.15.x
the hook gets removed just fine.
However, the problem with npm --version
at 3.x.x
remains. I have sketched a simple package.json that just echoes to console during install/uninstall. It produces the echo during install and stays silent during uninstall for both 3.8
and 3.10
. My expectation was that 3.8
would produce the same output for install and uninstall (as it does with local install of commitplease). It does not. So, I will look further. You are right, it looks like an issue to npm
is in order.
Interesting. Apparently I had reviewed https://github.com/jzaefferer/commitplease/commit/6603f0fd607006ce99bef531b7a4354dceb1ce46 but never noticed the additional backticks. No idea why they were added in the first place, but it makes sense that it broke the uninstall script.
Let's file the issue for npm 3.x with a reduced testcase, then document the workaround (manual uninstall) here, along with a link to the npm issue.
Looks good!
My
nvm --version
is0.31.0
With the following node/npm combinations
node --version
atv0.12.15
andnpm --version
at2.15.1
node --version
at4.4.7
andnpm --version
at2.15.8
this sequence of commands
calls
install.js
anduninstall.js
properly. It does not remove the hook though.With
node --version
at6.3.0
andnpm --version
at3.10.3
the same sequence of commands does not trigger uninstall.js at all.With
node --version
at6.1.0
andnpm --version
at3.8.6
the same sequence of commands triggers install.js duringnpm uninstall ../commitplease
, i.e. triggers the wrong script.