Installing multiple npm versions

后端 未结 3 2057
说谎
说谎 2021-02-12 12:59

Is it possible to install multiple versions of npm for different projects that I am working on or are the npm installations always global? (Windows 10)

3条回答
  •  春和景丽
    2021-02-12 13:40

    You can install multiple versions of npm by installing multiple versions of node. To do this, you can use nvm-windows. Each different installation of node installs a different version of npm

    To use a different version of node and nvm in a project, you simple need to switch:

    nvm use 5.0
    

    You can also create a .nvmrc file containing the version number in the project root directory. nvm will use the specified version of node for that project.

提交回复
热议问题