11.24
开发环境的配置:
npm config get registry -->获取地址
操作:
Windows PowerShell
版权所有 (C) Microsoft Corporation。保留所有权利。
尝试新的跨平台 PowerShell https://aka.ms/pscore6
PS C:\Windows\system32> node -v
v14.18.1
PS C:\Windows\system32> npm -v
6.14.15
PS C:\Windows\system32> npm config get registry
https://registry.npm.taobao.org/
PS C:\Windows\system32>
--
package name 包名
npm init -y -y使用默认值 ;一般性用 -y 的时候比较多
npm :是包管理器 。node :
npm install (安装) (后面的具体报名)
-g:全局安装 、--save:保存
node_modules:包:实时刷新
项目不建议 文件夹命名有空格
凡是识别不了 node -v 和 npm -v (未识别什么函数的)
设置中找-编辑环境变量-找node 把地址放进去
npm install nodemon --save: 安装
npm uninstall nodemon :uninstall卸载
npm install :当前项目里所有依赖的包 (不写包名时,)。(写包名:是安装的写的那个包)
node:
npm init -y 使用默认生成
npm 包管理器
npm install install是安装 -g全局安装
"dependencies": { //项目依赖
"nodemon": "^2.0.15"
}
npm install nodemon安装
npm uninstall nodemon卸载
npm install安装当前项目中所有包
理解
### 项目初始化
`npm init` init 初始化
`npm init -y`
### 安装项目依赖(包) --必须掌握
`npm install`
`npm install 包名`
`上面的那句话是默认当前项目能用`
`npm install 包名 --save`
`npm install 包名 -g`
`包名可以指定版本号 后面还是指令、没有指定版本号的默认安装的是最新版本`
`npm install 包名@版本号`
`比如:npm install 包名@1.0.0 (这里+-g/--save)`
` --save 和 -S是一样的`
###
`npm undate ...(包名 -g)` `...(包名 -g):...是后面的内容 +包名 和指令(根据要求更改)/另 -g指的是全局 `
### 卸载
`npm uninstall 包名` ` 这个后面+ ’-g‘ 是删除全局 ;不加--的话 删除的是当前的`

浙公网安备 33010602011771号