当前位置:网站首页>Under the NVM node installation;The node environment variable configuration
Under the NVM node installation;The node environment variable configuration
2022-08-09 23:44:00 【m0_67393828】
1, nvm installation
1. Double-click the installation file nvm-setup.exe
2. Select the nvm installation path
3. Select the nodejs path
4. Confirm the installation
5. Confirmation after installation
Open CMD and enter the command nvm , the installation is successful and the display is as follows.You can see that various commands are listed, and the Chinese instructions for these commands will be listed at the end of this section.
6. nvm manages node version
1. View all installable versions
nvm list available
2. View all locally installed versions
nvm list
3, installation, the version number in the command
nvm install 14.18.1
4. Use the specified node version
nvm use 14.18.1
5. Uninstall
nvm uninstall 14.18.1
7. Other nvm related commands
nvm arch : Shows whether node is running in 32-bit or 64-bit.nvm install [arch] : Install node, version is a specific version or the latest stable version latest.The optional parameter arch specifies whether to install the 32-bit or 64-bit version, and the default is the system bit.You can add --insecure to bypass the remote server's SSL.nvm list [available] : Displays a list of installed ones.The optional parameter available, displays all versions that can be installed.list can be simplified to ls.nvm on : Enable node.js version management.nvm off : Turn off node.js version management.nvm proxy [url] : Set download proxy.Without the optional parameter url, the current proxy is displayed.Setting url to none removes the proxy.nvm node_mirror [url] : Set the node mirror.The default is https://nodejs.org/dist/.If no url is written, the default url is used.After setting, you can view the settings.txt file in the installation directory, or operate directly in this file.nvm npm_mirror [url] : Set npm mirror.https://github.com/npm/cli/archive/.If no url is written, the default url is used.After setting, you can view the settings.txt file in the installation directory, or operate directly in this file.nvm uninstall : Uninstall the specified version of node.nvm use [version] [arch] : Use the specified version of node.32/64 bits can be specified.nvm root [path] : Set the directory where different versions of node are stored.If not set, the current directory is used by default.nvm version : Displays the nvm version.version can be simplified to v.
2, node.js installs a version not in the nvm list
1. Download the required node version
2. Create a relevant version folder in the nvm installation path
3. Double-click to install the node file
4. Install into the version folder created in the nvm folder
6. Check if the version is installed
7. View the current node version
node -v
3, node environment variable configuration
1. First, create two new folders node_global and node_cache in the installation directory of node.js
2. After creating the two folders, enter the following commands in the cmd window (the two paths are the paths of the two folders):
npm config set prefix "D:installodejsode_global"npm config set cache "D:installodejsode_cache"
3. Next, set the computer environment variables, right-click "My Computer" = "Properties =" Advanced System Settings = "Environment Variables" to enter the following environment variables dialog box.
4. Create a new environment variable NODE_PATH in [System Variables] with the value D:install odejs ode_global ode_modules, where D:install odejs ode_global is the global module installation path folder created above
5. Modify the path variable in [User Variables], and change C:UsershuaAppDataRoaming pm to D:install odejs ode_global
6. After clicking OK, the configuration is complete.
7. Test whether the configuration is successful, enter the following in the cmd window to specify the global installation of the express module
npm install -g express # -g means global installation
[The external link image transfer failed, the origin site may have an anti-leech mechanism, it is recommended to save the image and upload it directly (img-WEpTS7x3-1652185237994)(pictures/8782952-559fa6868c6d1a16.png)]
8. Domestic mirror website configuration
npm install -g cnpm --registry=https://registry.npm.taobao.org
9. When downloading modules in the future, replace npm with cnpm to download modules from Taobao mirrors, for example
cnpm install
Let me introduce myself first. The editor graduated from Shanghai Jiaotong University in 2013. I worked in a small company and went to big factories such as Huawei and OPPO. I joined Alibaba in 2018, until now.I know that most junior and intermediate java engineers want to upgrade their skills, they often need to explore their own growth or sign up to study, but for training institutions, the tuition fee is nearly 10,000 yuan, which is really stressful.Self-learning that is not systematic is very inefficient and lengthy, and it is easy to hit the ceiling and the technology stops.Therefore, I collected a "full set of learning materials for java development" for everyone. The original intention is also very simple. I hope to help friends who want to learn by themselves but don't know where to start, and at the same time reduce everyone's burden.Add the business card below to get a full set of learning materials
边栏推荐
猜你喜欢
2022 首期线下 Workshop!面向应用开发者们的数据应用体验日来了 | TiDB Workshop Day
小黑leetcode清爽雨天之旅,刚吃完宇飞牛肉面、麻辣烫和啤酒:112. 路径总和
论文解读(DropEdge)《DropEdge: Towards Deep Graph Convolutional Networks on Node Classification》
在VMware上安装win虚拟机
金山云地震,震源在字节?
几种绘制时间线图的方法
Several ways to draw timeline diagrams
STC8H开发(十五): GPIO驱动Ci24R1无线模块
leetcode 刷题日记 计算右侧小于当前元素的个数
Xiaohei's leetcode journey: 94. Inorder traversal of binary trees (supplementary Morris inorder traversal)
随机推荐
Flask入门学习教程
Tensorflow中placeholder函数的用法
TF生成均匀分布的tensor
In programming languages, the difference between remainder and modulo
LeetCode26:删除有序数组中的重复项
L3-2 至多删三个字符 (30 分)
TF uses constant to generate data
数独 | 回溯-7
从产品角度看 L2 应用:为什么说这是一个游乐场?
Simple questions peek into mathematics
knn到底咋回事?
宝塔实测-搭建LightPicture开源图床系统
POWER SOURCE ETA埃塔电源维修FHG24SX-U概述
金山云地震,震源在字节?
Tensorflow模型整体构建流程
TF中random.normal()与random.truncated_normal()
《强化学习周刊》第57期:DL-DRL、FedDRL & Deep VULMAN
kvm虚拟机出现启动不了,NOT available,PV大于分区
为什么这么多人都想当产品经理?
5个 Istio 访问外部服务流量控制最常用的例子,你知道几个?