What are the instructions for node.js?

藏色散人
Release: 2021-12-13 11:35:11
Original
2737 people have browsed it

node.js指令有:1、“npm config ls”;2、“npm install nrm -g”;3、“nrm ls”;4、“nrm use taobao”;5、“npm info xx”等等。

What are the instructions for node.js?

本文操作环境:Windows7系统,nodejs10.16.2版,Dell G3电脑。

node.js有哪些指令?

node.js 使用相关常用命令总结:

1. 下载并安装node.js

2. 设置全局模块存放的目录

2.1 查看默认配置

npm config ls
Copy after login

2.2 修改全局模块存放目录

npm config set prefix "e:\\stores\\nodejs\\node_modules\\node_global"
npm config set cache "e:\\stores\\nodejs\\node_modules\\node_global"
Copy after login

2.2.1 修改prefix 后需要在环境变量中添加:

"e:\\stores\\nodejs\\node_modules\\node_global"
Copy after login

3. 安装工具 nrm (全局安装)

npm install nrm -g
Copy after login

3.1 使用 nrm 更换镜像地址

nrm ls          //查看有哪些
nrm use taobao   //使用淘宝提供的镜像地址
Copy after login

nrm 仅仅是提供了几个常用的包地址,用 nrm use XX 来选择使用的地址

4 npm 查看包信息

4.1 查看远程包信息

方法一

npm info xx
Copy after login

方法二

nom view xx versions
Copy after login

4.2 查看本地包信息

npm ls xxx      //本地包
npm ls xxx -g   //全局包
Copy after login

推荐学习:《node.js视频教程

The above is the detailed content of What are the instructions for node.js?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!