Sfoglia il codice sorgente

完善了node的安装文档

seamew 3 anni fa
parent
commit
354c2d024f
2 ha cambiato i file con 35 aggiunte e 3 eliminazioni
  1. 34 3
      前端/node/npm安装和配置.md
  2. 1 0
      后端/JavaWeb/JavaWeb.md

+ 34 - 3
前端/node/npm安装和配置.md

@@ -1,13 +1,43 @@
-# 1.node的安装
+# 1、node的安装
+
+## 1.1、官方版本安装
 
 进入[node](https://nodejs.org/zh-cn/)官网下载安装包
 安装选择下面选项
 ![image-20210911173404485](../../照片/image-20210911173404485.png)
 
-# 2.更改npm和yarn依赖包全局下载和缓存路径
+## 1.2、nvm(windows)
 
-1. 在 D盘新建一个目录,用来存放 npm 或 yarn 的 cache 和 依赖包文件
+windows 用户请下载安装[nvm-windows](https://github.com/coreybutler/nvm-windows)
+```shell
+nvm install <version> [arch]: The version can be a specific version, "latest" for the latest current version, or "lts" for the most recent LTS version. Optionally specify whether to install the 32 or 64 bit version (defaults to system arch). Set [arch] to "all" to install 32 AND 64 bit versions. Add --insecure to the end of this command to bypass SSL validation of the remote download server.
+
+nvm list [available]: List the node.js installations. Type available at the end to show a list of versions available for download.
+nvm on: Enable node.js version management.
+
+nvm off: Disable node.js version management (does not uninstall anything).
+
+nvm use <version> [arch]: Switch to use the specified version. Optionally use latest, lts, or newest. newest is the latest installed version. Optionally specify 32/64bit architecture. nvm use <arch> will continue using the selected version, but switch to 32/64 bit mode. 
+
+nvm node_mirror <node_mirror_url>: Set the node mirror.People in China can use https://npmmirror.com/mirrors/node/
+
+nvm npm_mirror <npm_mirror_url>: Set the npm mirror.People in China can use https://npmmirror.com/mirrors/npm/
 ```
+## 1.3、n(linux)
+
+```shell
+# 1.安装n
+curl -L https://git.io/n-install | bash
+
+# 2.安装node
+n 14
+n lts
+```
+
+# 2、更改npm和yarn依赖包全局下载和缓存路径
+
+1. 在 D盘新建一个目录,用来存放 npm 或 yarn 的 cache 和 依赖包文件
+```shell
 D:\node_package\npm
 
 D:\node_package\npm_cache
@@ -27,6 +57,7 @@ npm config set registry https://registry.npm.taobao.org/
 
 
 # yarn
+yarn config set prefix "D:\node_package\yarn"
 yarn config set global-folder "D:\node_package\yarn"
 yarn config set cache-folder "D:\node_package\yarn_cache"
 yarn config set registry https://registry.npm.taobao.org/

+ 1 - 0
后端/JavaWeb/JavaWeb.md

@@ -333,6 +333,7 @@ req.getRequestDispatcher("/image").forward(req,resp);
 
 cookie
 * 客户端技术(响应,请求)
+
 session
 * 服务器技术,利用这个技术,可以保存用户的会话信息!我们可以把信息或者数据放入session