将nodejs迁移到D盘

news/2024/10/5 13:49:02/文章来源:https://www.cnblogs.com/dogleftover/p/18287393
  • 参考

  • 双击安装,指定d盘

  • 查看文件夹

  • 查看环境变量,自动添加如下

Path=D:\software\nodejs\
  • 打开cmd验证
C:\Users\dogle>node -v
v18.14.2C:\Users\dogle>npm -v
9.5.0C:\Users\dogle>echo %PATH%
C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;D:\software\Git\cmd;D:\Windows Kits\10\Windows Performance Toolkit\;D:\software\Anaconda3;D:\software\Anaconda3\Scripts;D:\software\Anaconda3\Library\bin;D:\software\Java\jdk-1.8\bin;D:\software\nodejs\;C:\Users\dogle\AppData\Local\Microsoft\WindowsApps;D:\software\Microsoft VS Code\bin;C:\Users\dogle\AppData\Local\Programs\EmEditor;C:\Users\dogle\AppData\Roaming\npm
  • 进入如下目录

  • 移动到nodejs安装目录并修改名称

  • 打开cmd执行如下命令

C:\Users\dogle>npm config set prefix "D:\software\nodejs\node_global"C:\Users\dogle>npm config set cache "D:\software\nodejs\node_cache"
  • 查看全局安装目录
C:\Users\dogle>npm list -global
D:\software\nodejs\node_global
`-- (empty)
  • 配置
# 镜像站
C:\Users\dogle>npm config set registry=http://registry.npm.taobao.org# 查看镜像信息
C:\Users\dogle>npm config get registry
http://registry.npm.taobao.org/# 查看所有配置信息
C:\Users\dogle>npm config list
; "builtin" config from D:\software\nodejs\node_modules\npm\npmrc; prefix = "C:\\Users\\dogle\\AppData\\Roaming\\npm" ; overridden by user; "user" config from C:\Users\dogle\.npmrccache = "D:\\software\\nodejs\\node_cache"
prefix = "D:\\software\\nodejs\\node_global"
registry = "http://registry.npm.taobao.org/"; node bin location = D:\software\nodejs\node.exe
; node version = v18.14.2
; npm local prefix = C:\Users\dogle
; npm version = 9.5.0
; cwd = C:\Users\dogle
; HOME = C:\Users\dogle
; Run `npm config ls -l` to show all defaults.# 查看C:\Users\dogle\.npmrc
registry=http://registry.npm.taobao.org/
prefix=D:\software\nodejs\node_global
cache=D:\software\nodejs\node_cache
  • 添加环境变量
NODE_PATH=D:\software\nodejs\node_global\node_modules
  • 以管理员身份打开cmd
C:\Windows\System32>npm install vue -gadded 20 packages in 2s3 packages are looking for fundingrun `npm fund` for detailsC:\Windows\System32>npm install vue-router -gadded 22 packages in 1s4 packages are looking for fundingrun `npm fund` for detailsC:\Windows\System32>npm install yarn -gadded 1 package in 773msC:\Windows\System32>npm install vue-cli -g
npm WARN deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm WARN deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated vue-cli@2.9.6: This package has been deprecated in favour of @vue/cli
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated consolidate@0.14.5: Please upgrade to consolidate v1.0.0+ as it has been modernized with several long-awaited fixes implemented. Maintenance is supported by Forward Email at https://forwardemail.net ; follow/watch https://github.com/ladjs/consolidate for updates and release changelog
npm WARN deprecated rimraf@2.7.1: Rimraf versions prior to v4 are no longer supported
npm WARN deprecated coffee-script@1.12.7: CoffeeScript on NPM has moved to "coffeescript" (no hyphen)added 233 packages in 8s11 packages are looking for fundingrun `npm fund` for detailsC:\Windows\System32>npm list -global
D:\software\nodejs\node_global
+-- vue-cli@2.9.6
+-- vue-router@4.4.0
+-- vue@3.4.31
`-- yarn@1.22.22
  • 查看文件夹

  • 添加如下环境变量
Path=D:\software\nodejs\node_global
  • 打开cmd测试
C:\Users\dogle>vue -V
2.9.6
  • 构建项目
D:\studyfile>vue init webpack vue01                                                          <--------------------- # 进入d盘? Project name vue01
? Project description A Vue.js project
? Author
? Vue build standalone
? Install vue-router? Yes
? Use ESLint to lint your code? No
? Set up unit tests No
? Setup e2e tests with Nightwatch? No
? Should we run `npm install` for you after the project has been created? (recommended) yarn      <--------------------- # 可以指定yarnvue-cli · Generated "vue01".# Installing project dependencies ...
# ========================yarn install v1.22.22
info No lockfile found.
[1/5] Validating package.json...
[2/5] Resolving packages...
warning vue@2.7.16: Vue 2 has reached EOL and is no longer actively maintained. See https://v2.vuejs.org/eol/ for more details.
warning autoprefixer > browserslist@2.11.3: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
warning babel-core > babel-runtime > core-js@2.6.12: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
warning babel-core > babel-register > core-js@2.6.12: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
warning copy-webpack-plugin > globby > glob@7.2.3: Glob versions prior to v9 are no longer supported
warning copy-webpack-plugin > cacache > glob@7.2.3: Glob versions prior to v9 are no longer supported
warning copy-webpack-plugin > cacache > rimraf@2.7.1: Rimraf versions prior to v4 are no longer supported
warning copy-webpack-plugin > cacache > rimraf > glob@7.2.3: Glob versions prior to v9 are no longer supported
warning copy-webpack-plugin > cacache > move-concurrently@1.0.1: This package is no longer supported.
warning copy-webpack-plugin > cacache > move-concurrently > rimraf@2.7.1: Rimraf versions prior to v4 are no longer supported
warning copy-webpack-plugin > globby > glob > inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
warning copy-webpack-plugin > cacache > move-concurrently > copy-concurrently@1.0.5: This package is no longer supported.
warning copy-webpack-plugin > cacache > move-concurrently > copy-concurrently > rimraf@2.7.1: Rimraf versions prior to v4 are no longer supported
warning copy-webpack-plugin > cacache > move-concurrently > fs-write-stream-atomic@1.0.10: This package is no longer supported.
warning copy-webpack-plugin > cacache > move-concurrently > copy-concurrently > fs-write-stream-atomic@1.0.10: This package is no longer supported.
warning css-loader > cssnano > autoprefixer > browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
warning css-loader > cssnano > postcss-merge-rules > browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
warning css-loader > cssnano > postcss-merge-rules > caniuse-api > browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
warning css-loader > cssnano > postcss-svgo > svgo@0.7.2: This SVGO version is no longer supported. Upgrade to v2.x.x.
warning css-loader > cssnano > postcss-merge-rules > postcss-selector-parser > flatten@1.0.3: flatten is deprecated in favor of utility frameworks such as lodash.
warning css-loader > cssnano > postcss-svgo > svgo > coa > q@1.5.1: You or someone you depend on is using Q, the JavaScript Promise library that gave JavaScript developers strong feelings about promises. They can almost certainly migrate to the native JavaScript promise now. Thank you literally everyone for joining me in this bet against the odds. Be excellent to each other.(For a CapTP with native promises, see @endo/eventual-send and @endo/captp)
warning extract-text-webpack-plugin@3.0.2: Deprecated. Please use https://github.com/webpack-contrib/mini-css-extract-plugin
warning html-webpack-plugin@2.30.1: out of support
warning optimize-css-assets-webpack-plugin > cssnano > cssnano-preset-default > postcss-svgo > svgo@1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x.
warning optimize-css-assets-webpack-plugin > cssnano > cssnano-preset-default > postcss-svgo > svgo > coa > q@1.5.1: You or someone you depend on is using Q, the JavaScript Promise library that gave JavaScript developers strong feelings about promises. They can almost certainly migrate to the native JavaScript promise now. Thank you literally everyone for joining me in this bet against the odds. Be excellent to each other.(For a CapTP with native promises, see @endo/eventual-send and @endo/captp)
warning optimize-css-assets-webpack-plugin > cssnano > cssnano-preset-default > postcss-svgo > svgo > stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
warning rimraf@2.7.1: Rimraf versions prior to v4 are no longer supported
warning shelljs > glob@7.2.3: Glob versions prior to v9 are no longer supported
warning uglifyjs-webpack-plugin > uglify-es@3.3.9: support for ECMAScript is superseded by `uglify-js` as of v3.13.0
warning vue-loader > consolidate@0.14.5: Please upgrade to consolidate v1.0.0+ as it has been modernized with several long-awaited fixes implemented. Maintenance is supported by Forward Email at https://forwardemail.net ; follow/watch https://github.com/ladjs/consolidate for updates and release changelog
warning webpack > acorn-dynamic-import@2.0.2: This is probably built in to whatever tool you're using. If you still need it... idk
warning webpack > watchpack > watchpack-chokidar2 > chokidar@2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
warning webpack > watchpack > watchpack-chokidar2 > chokidar > fsevents@1.2.13: The v1 package contains DANGEROUS / INSECURE binaries. Upgrade to safe fsevents v2
warning webpack > watchpack > watchpack-chokidar2 > chokidar > braces > snapdragon > source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
warning webpack > watchpack > watchpack-chokidar2 > chokidar > braces > snapdragon > source-map-resolve > resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
warning webpack > watchpack > watchpack-chokidar2 > chokidar > braces > snapdragon > source-map-resolve > source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
warning webpack > watchpack > watchpack-chokidar2 > chokidar > braces > snapdragon > source-map-resolve > urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
warning webpack-bundle-analyzer > bfj-node4@5.3.1: Switch to the `bfj` package for fixes and new features!
warning webpack-dev-server > chokidar@2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
warning webpack-dev-server > del > rimraf@2.7.1: Rimraf versions prior to v4 are no longer supported
warning webpack-dev-server > del > globby > glob@7.2.3: Glob versions prior to v9 are no longer supported
warning webpack-dev-server > sockjs > uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
[3/5] Fetching packages...
[4/5] Linking dependencies...
[5/5] Building fresh packages...
success Saved lockfile.
Done in 45.99s.
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...# Project initialization finished!
# ========================To get started:cd vue01npm run devDocumentation can be found at https://vuejs-templates.github.io/webpack                  <--------------------- # 构建成功D:\studyfile>cd vue01                                                                        <--------------------- # 进入项目文件夹D:\studyfile\vue01>yarn install                                                      <--------------------- # 安装依赖
yarn install v1.22.22
[1/5] Validating package.json...
[2/5] Resolving packages...
success Already up-to-date.
Done in 0.29s.
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...D:\studyfile\vue01>npm run dev                                                          <--------------------- # 运行> vue01@1.0.0 dev
> webpack-dev-server --inline --progress --config build/webpack.dev.conf.js(node:44168) [DEP0111] DeprecationWarning: Access to process.binding('http_parser') is deprecated.
(Use `node --trace-deprecation ...` to show where the warning was created)12% building modules 24/27 modules 3 active ...ndex=0!D:\studyfile\vue01\src\App.vue{ parser: "babylon" } is deprecated; we now treat it as { parser: "babel" }.95% emittingDONE  Compiled successfully in 1542ms                                                                          18:48:24I  Your application is running here: http://localhost:8080                                <--------------------- # 浏览器访问

环境变量
yarn安装的路径

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.hqwc.cn/news/739456.html

如若内容造成侵权/违法违规/事实不符,请联系编程知识网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

bluez 入门

**核心模块**:位于系统的最底层,直接与蓝牙硬件进行交互。核心模块实现了蓝牙的基础协议如HCI (Host Controller Interface),并通过DBUS提供API给上层应用。 **服务守护进程(bluetoothd)**:作为系统的守护进程运行,它处理所有的蓝牙服务和配置,如设备配对、连接管理、配…

chrome 浏览器如何设置不保存表单信息

chrome 浏览器如何设置不保存表单信息如何关闭表单自动填充(测试环境Chrome浏览器) https://download.csdn.net/blog/column/7594878/100576004如何禁用谷歌浏览器中的表单自动填充功能? https://zh-cn.fairsyndication.com/222-how-to-disable-form-autofill-in-google-chr…

数字设计--CDC

异步信号与同步信号 同步信号 频率相同,相位相同的两个信号 频率相同,相位差一定的两个信号 不同频率的两个信号也可能是同步的,比如分频出来的两个信号 异步信号 频率不同的两个信号 频率相同但相位差不定的两个信号 跨时钟域就是要解决信号从异步信号之间传输的问题。 亚稳…

数字设计--亚稳态

亚稳态 FPGA 等数字设备中的所有寄存器都定义了信号时序要求----允许每个寄存器在其输入端正确捕获数据并产生输出信号。为确保可靠操作,寄存器的输入必须在时钟边沿之前的最短时间(建立时间 setup time 或 \(t_{su}\))和时钟边沿之后的最短时间(保持时间 hold time 或 \(t…

数字设计--门控时钟与时钟切换

门控时钟(ICG) 使用门控时钟的原因 芯片功耗组成中,大部分是由时钟树消耗掉的。因为这些时钟树在系统中具有最高的切换频率,而且有很多时钟buffer,并且为了最小化时钟延时,它们通常具有很高的驱动强度。此外,即使输入和输出保持不变,接收时钟的触发器也会消耗一定的功耗。…

ComfyUI进阶篇:ComfyUI核心节点(二)

ComfyUI核心节点(二) 前言: 学习ComfyUI是一场持久战。当你掌握了ComfyUI的安装和运行之后,会发现大量五花八门的节点。面对各种各样的工作流和复杂的节点种类,可能会让人感到不知所措。在这篇文章中,我们将用通俗易懂的语言对ComfyUI的核心节点进行系统梳理,并详细解释每…

题目集7~8

由于个人原因,最后两次题目集未提交,对自己的放纵感到愧疚,后期的补练我也会抽出时间完成这两道题 经过分析,题目集7,是在前面的基础上加上了一个新概念:互斥开关,以及模拟一种受控窗帘, 在我的想法,互斥开关便可当作两个普通开关去完成电路,窗帘则是新增一个用电器。…

EtherCAT转Profinet网关配置说明第一讲:配置软件安装及介绍

网关XD-ECPNS20为EtherCAT转Profinet协议网关,使EtherCAT协议和Profinet协议两种工业实时以太网网络之间双向传输 IO 数据。适用于具有EtherCAT协议网络与Profinet协议网络跨越网络界限进行数据交换的解决方案。 网关XD-ECPNS20为EtherCAT转Profinet协议网关,使EtherCAT协议…

4、flask-项目拆分

项目的拆分其实就是将app.py中的工作拆分开来、类似Django一样、每个项目都把路由模板和试图函数分开写 app.py # 路由 + 视图函数from flask import Blueprint from models import *#蓝图 # 创建蓝图对象 # 第一个参数:蓝图的名字 # 第二个参数:蓝图的包名 blue = Blueprin…

2-SAT 问题

2-SAT 问题 模型有 \(n\) 个布尔类型的变量 \(x_1, x_2, \ldots, x_n\),有 \(m\) 条限制形如 \(x_i \space [\operatorname{or}/\operatorname{and}]\space x_j=[1/0]\). 求一组符合要求的解。核心问题只需要考虑有没有解。 对于每个变量都只有两种取值:\(0/1\),那么把每…

坚果云与floccus实现Chrome书签国内跨设备、跨平台同步

本文介绍基于floccus插件与坚果云协同使用的方法,对浏览器的书签进行实时在线同步的操作~本文介绍基于floccus插件与坚果云协同使用的方法,对浏览器的书签进行实时在线同步的操作。在工作与学习中,我们时常希望在不同浏览器之间实现书签的同步;而一些传统的浏览器书签同步方…

性能监控调优

1.命令行工具 1.1 jps 查看系统JVM进程 jps [options] [hostid]optionhostid:省略则本机,监控远程需要安装jstatd1.2 jstat 查看JVM统计信息 jstat -[-t] [-h] [[]]option-t:加程序运行时间 [-h]:输出设定行数加表头信息 :查询间隔时间 count:查询总次数 结果:当ou上涨趋…