当前位置:网站首页>Node学习笔记
Node学习笔记
2022-08-06 21:28:00 【bug制造工程师!!!】
Node学习
安装Node
一、node.js下载
node.js下载地址:https://nodejs.org/en/

二、安装node.js
点击next

勾选接受条款,点击next

自定义安装位置,点击next

点击next

直接点击next

直接点击install


安装完成,使用命令行操作检测安装是否成功


环境配置
Node一般安装完后一般自带npm
npm -v

环境配置
在nodejs安装的路径下,新增node_global和node_cache文件夹

修改npm 和 npm.cmd文件中配置信息
将打开后将2个文件里面的prefix -g替换为prefix --location=global

在创建完以上两个空文件夹后,在cmd命令中,输入以下设置命令
自己的安装路径一定要注意!!!
npm config set prefix "D:\DevelopTools\NodeJS\node_global"
npm config set cache "D:\DevelopTools\NodeJS\node_cache

安装淘宝镜像:npm install -g cnpm --registry=https://registry.npm.taobao.org
系统环境变量设置
在环境变量 ——> 系统变量——>新建:变量名为 NODE_PATH, 值为D:\DevelopTools\NodeJS\node_global\node_modules

最后编辑用户变量里的Path,将相应npm的路径改为:D:\DevelopTools\NodeJS\node_global,如下:

测试
在cmd命令中执行命令:npm install webpack -g
执行完成后查看自定义的文件夹是否生效

webpack已安装成功,执行 npm webpack -v 可以看到所安装webpack的版本号:

查看当前镜像仓库:
npm config get registry

设置淘宝全局镜像(以管理员身份运行CMD):

设置淘宝全局镜像(以管理员身份运行CMD):
npm config set registry https://registry.npm.taobao.org
切换回默认地址
npm config set registry https://registry.npmjs.org/
使用nrm工具切换
切换淘宝源
npx nrm use taobao
切换回官方源
npx nrm use npm
安装cnpm
操作命令:npm install -g cnpm --registry=https://registry.npmmirror.com
检测:cnpm -v

查看全局安装的模块
npm list -g
查看某个模块的版本号
npm list vue
安装提定版本包
npm install [email protected]
更新到最新版的包
npm update jquery
卸载包
npm uninstall jquery
边栏推荐
- 分布式理论
- 复现一个循环问题以及两个循环问题
- 硅谷课堂第八课-腾讯云点播管理模块(三)
- 嵌入式系统驱动初级【8】——设备树
- 如何在IDEA中创建接口和接口实现类
- Flume (一) --------- Flume 概述
- pinia 基于插件pinia-plugin-persist的 持久化
- 一文带你了解webrtc基本原理(动手实现1v1视频通话)
- Vulhub 刷题(一)
- Four cases of adjustment after the AVL tree is inserted into a new node (left single rotation, right single rotation, double rotation)
猜你喜欢
随机推荐
话费优惠
2022年最新辽宁建筑八大员(电气施工员)模拟题库及答案
What can the "Ninth-Order Evaluation Model" bring?
2. Basic concepts of linear tables + basic operations
嵌入式系统驱动初级【8】——设备树
硅谷课堂第二课-搭建项目环境和开发讲师管理接口
【边缘部署 AI】
Redis+Redisson basic configuration and use
distributed theory
xss-labs靶场1~7详解
后出海时代:“陡坡式增长”失速,“阶梯式增长”到来
六月券商金工精选
Detailed explanation of xss-labs shooting range 1~7
什么是鸟撞?该如何设计防鸟撞的建筑?#可持续设计
单片机开发琐碎知识记录
Huawei Device User Access and Authentication Configuration Commands
数据字典中的三种类型数据表
A Preliminary Study on Netgen Volume Meshing and Display of CAD Based on OSG+OCC
[target detection] data enhancement: YOLO official data enhancement implementation / simple use of imgaug
嵌入式系统驱动初级【9】——中断处理上_基础框架








![[BPU部署教程] 一文带你轻松走出模型部署新手村](/img/1c/93b5d3807d424152c95b113447e473.png)
