Nvm for windows安装

Posted 临风而眠

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Nvm for windows安装相关的知识,希望对你有一定的参考价值。

Nvm for windows安装

  • AI applications 爆炸的时代,我们要学会好好利用他们帮助我们solve problems ,建立我们高效率的workflow,并总结怎样利用他们更好地帮我们快速解决问题

  • 安装nvm for windows起因是今早收到了GitHub copilot CLI 的内测邀请

  • 然后赶紧去试了试,结果在npm install的时候显示版本不符:

    npm WARN notsup Unsupported engine for radash@9.5.0: wanted: "node":">=14.18.0" (current: "node":"14.17.0","npm":"6.14.13")
    npm WARN notsup Not compatible with your version of node/npm: radash@9.5.0
    
  • 看来是要升级node,于是我就问chatgpt:

    How can I upgrade node to 14.18.0

    • 以下是chatgpt的回答

      To upgrade your Node.js version to 14.18.0, you can follow these steps:

      1. First, you need to check if Node.js is already installed on your system and which version you are currently using. To do this, open a terminal or command prompt and run the following command:

        node -v
        

        This will print the current version of Node.js installed on your system.

      2. If you don’t have Node.js installed or if you have an older version than 14.18.0, you can download the latest version from the official Node.js website at https://nodejs.org/en/download/. Choose the appropriate installer for your operating system and follow the installation instructions.

      3. If you already have Node.js installed, you can use a version manager tool like nvm (Node Version Manager) to switch to version 14.18.0. To install nvm, follow the instructions at https://github.com/nvm-sh/nvm#installing-and-updating. Once nvm is installed, you can run the following command to install and switch to Node.js 14.18.0:

        nvm install 14.18.0
        nvm use 14.18.0
        

        This will download and install Node.js version 14.18.0 and set it as the active version.

      4. Finally, you can verify that you have upgraded to the correct version of Node.js by running the node -v command again, which should now output the new version number.

  • 于是,随着它的指引

  • 接下来,在页面里面 ctrl f 迅速定位如何install

    • 于是跟着指引 ,先去geek里面卸载了之前的node.js

      接着下载了 latest 版本的 nvm-steup.zip ,里面有nvm-setup.exe,安装了之后

      继续跟着文档来:

      nvm -v
      

      nvm install 14.18.0
      nvm use 14.18.0
      npm install g-yarn
      
      

      好耶!

      然后可以npm install copilot的东西啦!!!

  • npm,nvm, node 科普(面向自己)

    以下为New Bing的回答

    我很高兴能继续帮助你理解nvm,npm和node之间的区别。😊

    • node是一个javascript运行时环境,它可以让你在服务器端或者命令行上执行JavaScript代码。
    • npm是node的默认包管理工具,它可以让你安装、更新、卸载和管理node的依赖包。
    • nvm是一个用来下载、安装、管理和升级不同版本的node的工具,它可以让你在同一台机器上轻松切换不同版本的node和npm¹²³。

    简单来说,nvm是用来安装和管理node的,npm是用来安装和管理node的包的。他们都依赖于node环境,但不依赖于彼此。⁴

    我希望这能帮助你更好地理解他们之间的关系。👍

    Source: Conversation with Bing, 2023/3/14(1) NVM vs. NPM Vs. Yarn. So you want to use Node.JS and you want… | by … https://medium.com/@haymuir/nvm-vs-npm-vs-yarn-ec65fd3da573 Accessed 2023/3/14.
    (2) Node version manager: nvm and n difference - SoByte. https://www.sobyte.net/post/2022-04/node-mvn-n/ Accessed 2023/3/14.
    (3) NVM vs NPM | phoenixNAP IT Glossary. https://phoenixnap.com/glossary/nvm-vs-npm Accessed 2023/3/14.
    (4) node.js - Difference between NPM and NVM - Stack Overflow. https://stackoverflow.com/questions/32660993/difference-between-npm-and-nvm Accessed 2023/3/14.

  • 看看自己的版本

    以下回答来自New Bing

    你好,这是必应。我看到你分享了你的node,npm和nvm的版本信息。😊

    根据这些信息,我可以看出你正在使用Windows操作系统,并且已经安装了node 14.18.0,npm 6.14.15和nvm 1.1.10。

    如果你想升级到最新的node或者npm版本,你可以使用nvm来切换或者安装不同的版本。例如,你可以运行以下命令来安装最新的node 18.8.3:

    nvm install 18.8.3
    

    然后,你可以运行以下命令来切换到这个版本:

    nvm use 18.8.3
    

    如果你想升级到最新的npm版本,你可以运行以下命令:

    npm install npm@latest -g
    

    我希望这能帮助你保持你的node和npm更新。👍

    以下回答来自ChatGpt

    Node.js is a runtime environment that allows you to run JavaScript code outside of a web browser. npm is a package manager for Node.js that allows you to easily install, manage, and share packages of reusable code. nvm is a tool that allows you to manage multiple versions of Node.js on your system.

    Node.js is the underlying platform that npm and nvm are built on. npm is bundled with Node.js and is automatically installed when you install Node.js. nvm, on the other hand, is a separate tool that you need to install separately.

    npm is used to manage packages of reusable code for Node.js. You can use npm to install packages from the npm registry, publish your own packages, and manage dependencies for your Node.js projects.

    nvm is used to manage different versions of Node.js on your system. It allows you to install multiple versions of Node.js and easily switch between them. This is useful when you need to test your code with different versions of Node.js or when you need to work on projects that require different versions of Node.js.

    In summary, Node.js provides the runtime environment for executing JavaScript code outside of a web browser, npm is a package manager for Node.js that allows you to manage packages of reusable code, and nvm is a tool that allows you to manage different versions of Node.js on your system.

以上是关于Nvm for windows安装的主要内容,如果未能解决你的问题,请参考以下文章

windows上安装nvm后选择node版本出现exit status 1怎么解决

前端自动化之nvm安装

node环境配置

node环境配置

nvm无法识别命令

nvm-windows下载安装图文教程