Node.js 常用命令
2023-09-11 14:17:57 时间
1. 查看node版本
node --version
2. 查看npm 版本,检查npm 是否正确安装。
npm -v
3. 安装cnpm (国内淘宝镜像源),主要用于某些包或命令程序下载不下来的情况
npm install cnpm -g --registry=https://registry.npm.taobao.org
4. 安装express模块
npm install express
5. 全局安装express模块
npm install -g express
6. 列出已安装模块
npm list
7. 显示模块详情
npm show express
8. 升级当前目录下的项目的所有模块
npm update
9. 升级当前目录下的项目的指定模块
npm update express
10. 升级全局安装的express模块
npm update -g express
11. 删除指定的模块
npm uninstall express
12. 更新node 版本
首先需要确保是否安装 n 模块,这个是node升级需要
没有安装执行:npm i n -g -f
检测使用: n --version
更新node命令:n stable
13. node 引入模块使用 require
var http = require("http")
后续更新中...
相关文章
- JS框架_(JQuery.js)模拟刮奖
- Node.js之Console用法小结
- JS魔法堂:彻底理解0.1 + 0.2 === 0.30000000000000004的背后
- js 改变只读属性的值
- js的点表示法和方括号表示法
- [Tools] Install and Manage Node.js Versions with nvm
- [Node.js]30. Level 6: Listen 'Question' from client, and then Answer the Question
- node.js实现国标GB28181流媒体点播(即实时预览)服务解决方案
- [Tools] Batch Create Markdown Files from a Template with Node.js and Mustache
- [Tools] Convert SVG to a PDF in Node with PDFKit and SVG.js
- [Nuxt] Build a Navigation Component in Vue.js and Use in a Nuxt Layout
- [Node.js] Pass command line arguments to node.js
- [Node.js] node-persist: localStorage on the server
- js中高效拼接字符串
- Atitit 前端测试最简化内嵌web服务器 php 与node.js 目录 1.1. php内置Web Server1 1.2. Node的2 Node的比较麻烦些。。Php更加简单
- paip.java 以及JavaScript (js) 的关系以及区别
- 华为OD机试 - 网上商城优惠活动(Java & JS & Python)
- js php 数组比較
- js mutationobserver property vs attribute
- Node.js express模块(二)
- Node.js学习笔记——包管理工具