How to upgrade node.js on Windows?

后端 未结 9 890
悲哀的现实
悲哀的现实 2021-01-30 15:48

I already have Node.js v0.8.0 running on Windows. Can I just run the latest installer to upgrade it to v0.8.4? I am afraid it will break existing third party modules on my machi

9条回答
  •  有刺的猬
    2021-01-30 16:31

    I don't have experience with node on Windows, but I have just upgraded node & modules on my Mac, so this is just a general answer:

    If you install v0.8, you might break your existing node modules, if they use deprecated functions, etc. The problem is that npm only checks your version of node while modules are being installed, not at run-time.

    To be on the safe side, you need to find the global node_modules folder on your machine, back it up to somewhere, then delete and reinstall the modules. You will need to do the same thing for the node_modules folders in the apps you are using. (Assuming you have package.json files, reinstalling these should be easy.)

    In practice, I don't think any of the modules I was using were actually incompatible. Good luck.

提交回复
热议问题