首页 > 编程语言 >将nodejs迁移到D盘

将nodejs迁移到D盘

时间:2024-07-06 19:10:35浏览次数:8  
标签:npm nodejs supported webpack warning no D盘 迁移 software

  • 参考

  • 双击安装,指定d盘

  • 查看文件夹

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

Path=D:\software\nodejs\
  • 打开cmd验证
C:\Users\dogle>node -v
v18.14.2

C:\Users\dogle>npm -v
9.5.0

C:\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\.npmrc

cache = "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 -g

added 20 packages in 2s

3 packages are looking for funding
  run `npm fund` for details

C:\Windows\System32>npm install vue-router -g

added 22 packages in 1s

4 packages are looking for funding
  run `npm fund` for details

C:\Windows\System32>npm install yarn -g

added 1 package in 773ms

C:\Windows\System32>npm install vue-cli -g
npm WARN deprecated [email protected]: 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 [email protected]: Glob versions prior to v9 are no longer supported
npm WARN deprecated [email protected]: this library is no longer supported
npm WARN deprecated [email protected]: 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 [email protected]: This package has been deprecated in favour of @vue/cli
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: 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 [email protected]: Rimraf versions prior to v4 are no longer supported
npm WARN deprecated [email protected]: CoffeeScript on NPM has moved to "coffeescript" (no hyphen)

added 233 packages in 8s

11 packages are looking for funding
  run `npm fund` for details

C:\Windows\System32>npm list -global
D:\software\nodejs\node_global
+-- [email protected]
+-- [email protected]
+-- [email protected]
`-- [email protected]
  • 查看文件夹

  • 添加如下环境变量
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      <--------------------- # 可以指定yarn

   vue-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 [email protected]: Vue 2 has reached EOL and is no longer actively maintained. See https://v2.vuejs.org/eol/ for more details.
warning autoprefixer > [email protected]: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
warning babel-core > babel-runtime > [email protected]: 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 > [email protected]: 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 > [email protected]: Glob versions prior to v9 are no longer supported
warning copy-webpack-plugin > cacache > [email protected]: Glob versions prior to v9 are no longer supported
warning copy-webpack-plugin > cacache > [email protected]: Rimraf versions prior to v4 are no longer supported
warning copy-webpack-plugin > cacache > rimraf > [email protected]: Glob versions prior to v9 are no longer supported
warning copy-webpack-plugin > cacache > [email protected]: This package is no longer supported.
warning copy-webpack-plugin > cacache > move-concurrently > [email protected]: Rimraf versions prior to v4 are no longer supported
warning copy-webpack-plugin > globby > glob > [email protected]: 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 > [email protected]: This package is no longer supported.
warning copy-webpack-plugin > cacache > move-concurrently > copy-concurrently > [email protected]: Rimraf versions prior to v4 are no longer supported
warning copy-webpack-plugin > cacache > move-concurrently > [email protected]: This package is no longer supported.
warning copy-webpack-plugin > cacache > move-concurrently > copy-concurrently > [email protected]: This package is no longer supported.
warning css-loader > cssnano > autoprefixer > [email protected]: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
warning css-loader > cssnano > postcss-merge-rules > [email protected]: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
warning css-loader > cssnano > postcss-merge-rules > caniuse-api > [email protected]: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
warning css-loader > cssnano > postcss-svgo > [email protected]: This SVGO version is no longer supported. Upgrade to v2.x.x.
warning css-loader > cssnano > postcss-merge-rules > postcss-selector-parser > [email protected]: flatten is deprecated in favor of utility frameworks such as lodash.
warning css-loader > cssnano > postcss-svgo > svgo > coa > [email protected]: 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 [email protected]: Deprecated. Please use https://github.com/webpack-contrib/mini-css-extract-plugin
warning [email protected]: out of support
warning optimize-css-assets-webpack-plugin > cssnano > cssnano-preset-default > postcss-svgo > [email protected]: 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 > [email protected]: 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 > [email protected]: 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 [email protected]: Rimraf versions prior to v4 are no longer supported
warning shelljs > [email protected]: Glob versions prior to v9 are no longer supported
warning uglifyjs-webpack-plugin > [email protected]: support for ECMAScript is superseded by `uglify-js` as of v3.13.0
warning vue-loader > [email protected]: 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 > [email protected]: This is probably built in to whatever tool you're using. If you still need it... idk
warning webpack > watchpack > watchpack-chokidar2 > [email protected]: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
warning webpack > watchpack > watchpack-chokidar2 > chokidar > [email protected]: The v1 package contains DANGEROUS / INSECURE binaries. Upgrade to safe fsevents v2
warning webpack > watchpack > watchpack-chokidar2 > chokidar > braces > snapdragon > [email protected]: See https://github.com/lydell/source-map-resolve#deprecated
warning webpack > watchpack > watchpack-chokidar2 > chokidar > braces > snapdragon > source-map-resolve > [email protected]: https://github.com/lydell/resolve-url#deprecated
warning webpack > watchpack > watchpack-chokidar2 > chokidar > braces > snapdragon > source-map-resolve > [email protected]: See https://github.com/lydell/source-map-url#deprecated
warning webpack > watchpack > watchpack-chokidar2 > chokidar > braces > snapdragon > source-map-resolve > [email protected]: Please see https://github.com/lydell/urix#deprecated
warning webpack-bundle-analyzer > [email protected]: Switch to the `bfj` package for fixes and new features!
warning webpack-dev-server > [email protected]: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
warning webpack-dev-server > del > [email protected]: Rimraf versions prior to v4 are no longer supported
warning webpack-dev-server > del > globby > [email protected]: Glob versions prior to v9 are no longer supported
warning webpack-dev-server > sockjs > [email protected]: 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 vue01
  npm run dev

Documentation 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                                                          <--------------------- # 运行

> [email protected] 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% emitting

 DONE  Compiled successfully in 1542ms                                                                          18:48:24

 I  Your application is running here: http://localhost:8080                                <--------------------- # 浏览器访问

  • 使用yarn安装依赖
点击查看详情

标签:npm,nodejs,supported,webpack,warning,no,D盘,迁移,software
From: https://www.cnblogs.com/dogleftover/p/18287393

相关文章

  • mac os 迁移后,编译链接foundation的qt 项目失败
    error:unknowntypename'CFAttributedStringRef';didyoumean'NSAttributedStringKey'?CFAttributedStringRefattrString)CT_AVAILABLE(macos(10.5),ios(3.2),watchos(2.0),tvos(9.0));^/Library/Developer/CommandLineTools/SDKs/MacOSX1......
  • 数据库迁移工具
    对于国产数据库数据往Oracle数据库上迁移的需求,推荐使用以下几种迁移软件: 1.达梦数据迁移工具简介:达梦数据库自带的数据迁移工具,特别适用于达梦数据库(DM)到Oracle数据库的迁移。特点:专门为达梦数据库设计,对达梦数据库的特性有深入的支持。图形化界面,操作简便,用户可以通过简......
  • Elasticsearch数据迁移工具之ESM
    Elasticsearch数据迁移工具之ESMESM版本:0.5.0上传esm的tar包并解压查看一下帮助文档并确认安装成功ESM各个参数用法简介在使用Elasticsearch的时候不可避免的会涉及到集群的升级或者是业务的迁移等场景,此时就需要对数据进行迁移,es数据迁移的工具有很多比如reindex、esm、elas......
  • nodejs 安装使用ip2region - 实时精准的IP地址到区域运营商查询
    ip2region简介ip2region是一个高性能且高准确度的离线IP地址定位库和IP定位数据管理框架。它能够根据IP地址解析出对应的位置信息,包括国家、地区、省份、城市以及互联网服务提供商(ISP)。以下是ip2region的一些关键特性:高准确率:它声称有99.9%的准确率,这使得它......
  • windows安装以及切换使用nodejs多版本
    1安装nvmnvm是一个简单的bash脚本,它是用来管理系统中多个已存的Node.js版本。可以先把系统已有的node卸载掉,也可不卸载,但是以防没必要的冲突,尽量还是卸掉。1.1下载nvm下载地址:https://github.com/coreybutler/nvm-windows/releases,下载.zip后缀的这个文件,下载后解压安装即可......
  • [NodeJS] timers阶段的源码解析
    timers阶段是Nodejs事件循环中的一个阶段,这一阶段主要是检查是否有到期的定时器,如果有则执行其回调。相关源码位置:timers阶段:node/deps/uv/src/timer.catmain·nodejs/node(github.com)timers阶段的代码比较少,这里直接贴出来,你也可以点进去上面的源码看自己感兴趣的部分......
  • [NodeJS] NodeJS事件循环
    JS是单线程的,如果出现阻塞会严重影响代码执行效率。NodeJS通过事件循环,尽可能地将耗时任务委派给系统内核来实现非阻塞IO。NodeJS提供了许多和异步相关的API,除了语言标准规定的setTimeout和setInterval,还有setImmediate和process.nextTick。经常和这几个出现在面试题里的还有Pr......
  • nodejs删除和重新安装
    若重新安装nodejs本人使用卸载并重新安装的方法,简单暴力卸载1.找到以前安装nodejs的文件路径,直接删除2.例如我的在D盘路径,直接卸载3.然后删除配置环境:右键此电脑——属性——高级系统设置——高级——环境变量4.找到用户变量在path关于node与npm并删除5.系统变......
  • Windows上实现jdk、Mysql(含数据)整体环境和配置以及数据迁移复用(Bat中实现jdk、mysq
    场景若依前后端分离版手把手教你本地搭建环境并运行项目:https://blog.csdn.net/BADAO_LIUMANG_QIZHI/article/details/108465662前后端分离的系统,需要部署在windows服务器上,若后期需要部署的机器较多,则每台机器都需要安装jdk、配置jdk环境变量、安装mysql、配置mysql环境变量......
  • nodejs的安装及使用
    node官网:Node.js中文网、Node.js官网node安装包下载:下载|Node.js中文网、DownloadNode.js®、node的安装法1:直接下载安装node打开下载好的安装程序->接受许可协议、选择安装路径(默认c盘)->Install完成安装法2:通过nvm安装具体参照:nvm的安装及使用-CSDN博客注意......