Node installation and npm package manager for installing third-party libraries

Node installation and npm package manager for installing third-party libraries

node installation

insert image description here
insert image description here
insert image description here
insert image description here

insert image description here
insert image description here
insert image description here
insert image description here

Create a node project

insert image description here

initialize npm init -y

insert image description here
insert image description here
insert image description here
insert image description here

npm package manager for installing third-party libraries

Install a third-party library (jquery as an example)

insert image description here
insert image description here

View plugins

insert image description here

Uninstall third-party libraries

insert image description here

Common npm commands

 查看node版本:node -v
 初始化node项目:npm init -y   
 安装:
       npm    i     pkg1 pkg2 pkg3     局部安装
       npm  i  pkg  -g    全局安装
        npm root view -g  查看全局安装目录
        npm  i  pkg  -D    开发时使用
        npm  i  pkg  -S     开发和上线后都使用
        npm i   pkg@版本    指定版本安装
        npm list 查看插件
 卸载:    
       npm  uninstall    pkg
       npm  remove    pkg
       npm r jquery
更新:
      npm view jquery versions   查看历史版本
      npm update  jquery
运行:node index.js
安装和卸载帮助命令:
	 npm install -h
	 npm uninstall -h

Guess you like

Origin blog.csdn.net/adminsir0/article/details/126839589
Recommended