Nvm for windows安装
创始人
2024-06-03 12:26:25

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.

  • 于是,随着它的指引

    • 我来到了 https://github.com/nvm-sh/nvm#installing-and-updating

    • 跟着执行了这个指令(cmd里面可以,powershell里面报错)

      image-20230314111141351

    • 搞完之后突然发现文档里面写了这个👇
      在这里插入图片描述

    • 于是我就去看了 [nvm-windows]👇

      coreybutler/nvm-windows: A node.js version management utility for Windows. Ironically written in Go. (github.com)

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

    image-20230314111453164
    • 于是跟着指引 ,先去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.

  • 看看自己的版本

    image-20230314112321976

    以下回答来自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.

相关内容

热门资讯

苗族的传统节日 贵州苗族节日有... 【岜沙苗族芦笙节】岜沙,苗语叫“分送”,距从江县城7.5公里,是世界上最崇拜树木并以树为神的枪手部落...
北京的名胜古迹 北京最著名的景... 北京从元代开始,逐渐走上帝国首都的道路,先是成为大辽朝五大首都之一的南京城,随着金灭辽,金代从海陵王...
世界上最漂亮的人 世界上最漂亮... 此前在某网上,选出了全球265万颜值姣好的女性。从这些数量庞大的女性群体中,人们投票选出了心目中最美...
猫咪吃了塑料袋怎么办 猫咪误食... 你知道吗?塑料袋放久了会长猫哦!要说猫咪对塑料袋的喜爱程度完完全全可以媲美纸箱家里只要一有塑料袋的响...
应用未安装解决办法 平板应用未... ---IT小技术,每天Get一个小技能!一、前言描述苹果IPad2居然不能安装怎么办?与此IPad不...