JamieMason / shrinkpack

Fast, resilient, reproducible builds with npm install.
https://www.npmjs.com/package/shrinkpack
MIT License
793 stars 38 forks source link

Uninstall but still present ? #53

Closed maiis closed 8 years ago

maiis commented 8 years ago

Expected behaviour

After uninstalling shrinkpack, I'd except my npm-shrinkwrap.json not to refer to file:node_shrinkwrap

Actual behaviour

npm-shrinkwrap.json still contains references to node_shrinkwrap/

Steps to reproduce

npm uninstall -g shrinkpack npm shrinkwrap

Software versions used

OS : OS X 10.11.5 node.js : v6.2.2 npm : 3.10.4

Log output when running shrinkpack

zsh: command not found: shrinkpack

Contents of your npm-shrinkwrap.json or package.json

    "yargs-parser": {
      "version": "2.4.0",
      "from": "yargs-parser@>=2.4.0 <3.0.0",
      "resolved": "file:node_shrinkwrap/yargs-parser-2.4.0.tgz"
    },
JamieMason commented 8 years ago

Thanks for raising this @maiis.

I think there is a difference between removing the files that make up the tool itself and removing/undoing the things you did while using the tool. For example, if I were to use ImageOptim to optimise a folder of images and then uninstalled ImageOptim – I wouldn't expect all those images to be deoptimised afterwards.

There are other examples of this (SASS, fixmyjs, Babel, anything really).

When you uninstall a tool you're just removing the tool, not undoing everything you used it for.

Does that makes sense? Have I understood your question correctly?

maiis commented 8 years ago

@JamieMason LOL you are right but that wasn't my problem. I've undo everything, except if there is some special things to do to uninstall ? I deleted node_shrinkwrap folder and npm-shrinkwrap.json, then re-run "npm shrinkwrap" so a new .json is created with resolved containing "file:node_shrinkwrap/xxx"... hence my confusion

JamieMason commented 8 years ago

haha, I did wonder for a minute there. Ok, I think I understand now – does this work?

npm uninstall -g shrinkpack
rm -rf ./node_shrinkwrap npm-shrinkwrap.json
npm cache clean
npm shrinkwrap
maiis commented 8 years ago

It does... npm cache clear, forget to do that. I knew it was something obvious, thanks for your help 👍

JamieMason commented 8 years ago

You're welcome, I think this is actually another example of the problem being looked at in #31.