当前位置: 首页 > news >正文

npm i 常见问题

需要注意的是,如果你在使用 NPM 安装包的过程中遇到了任何问题,可以尝试使用 --verbose 参数打印更详细的错误信息,以便更好地诊断问题。例如:
npm install --verbose

1、vue老项目缺少编译环境安装依赖报错的问题

待下载的项目依赖 package.json

{"name": "music_level","version": "0.1.0","private": true,"scripts": {"start": "vue-cli-service serve","build": "vue-cli-service build","lint": "vue-cli-service lint"},"dependencies": {"axios": "^0.21.1","core-js": "^3.6.5","echarts": "^4.8.0","element-plus": "^1.1.0-beta.8","vue": "^3.0.0","vue-router": "^4.0.0-0","vuex": "^4.0.0-0"},"devDependencies": {"@vue/cli-plugin-babel": "~4.5.0","@vue/cli-plugin-eslint": "~4.5.0","@vue/cli-plugin-router": "~4.5.0","@vue/cli-plugin-vuex": "~4.5.0","@vue/cli-service": "~4.5.0","@vue/compiler-sfc": "^3.0.0","@vue/eslint-config-standard": "^5.1.2","babel-eslint": "^10.1.0","eslint": "^6.7.2","eslint-plugin-import": "^2.20.2","eslint-plugin-node": "^11.1.0","eslint-plugin-promise": "^4.2.1","eslint-plugin-standard": "^4.0.0","eslint-plugin-vue": "^7.0.0","lint-staged": "^9.5.0","node-sass": "^4.12.0","sass-loader": "^8.0.2"},"gitHooks": {"pre-commit": "lint-staged"},"lint-staged": {"*.{js,jsx,vue}": ["vue-cli-service lint","git add"]}
}

npm i 的报错信息

npm ERR! code 1
npm ERR! path C:\Users\whero\Desktop\新建文件夹\node_modules\node-sass
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c node scripts/build.js
npm ERR! Building: C:\Program Files\nodejs\node.exe C:\Users\whero\Desktop\新建文件夹\node_modules\node-gyp\bin\node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp verb cli [
npm ERR! gyp verb cli   'C:\\Program Files\\nodejs\\node.exe',
npm ERR! gyp verb cli   'C:\\Users\\whero\\Desktop\\新建文件夹\\node_modules\\node-gyp\\bin\\node-gyp.js',
npm ERR! gyp verb cli   'rebuild',
npm ERR! gyp verb cli   '--verbose',
npm ERR! gyp verb cli   '--libsass_ext=',
npm ERR! gyp verb cli   '--libsass_cflags=',
npm ERR! gyp verb cli   '--libsass_ldflags=',
npm ERR! gyp verb cli   '--libsass_library='
npm ERR! gyp verb cli ]
npm ERR! gyp info using node-gyp@3.8.0
npm ERR! gyp info using node@16.14.0 | win32 | x64
npm ERR! gyp verb command rebuild []
npm ERR! gyp verb command clean []
npm ERR! gyp verb clean removing "build" directory
npm ERR! gyp verb command configure []
npm ERR! gyp verb check python checking for Python executable "python2" in the PATH
npm ERR! gyp verb `which` succeeded python2 C:\Python27\python2.EXE
npm ERR! gyp verb check python version `C:\Python27\python2.EXE -c "import sys; print "2.7.15
npm ERR! gyp verb check python version .%s.%s" % sys.version_info[:3];"` returned: %j
npm ERR! gyp verb get node dir no --target version specified, falling back to host node version: 16.14.0
npm ERR! gyp verb command install [ '16.14.0' ]
npm ERR! gyp verb install input version string "16.14.0"
npm ERR! gyp verb install installing version: 16.14.0
npm ERR! gyp verb install --ensure was passed, so won't reinstall if already installed
npm ERR! gyp verb install version is already installed, need to check "installVersion"
npm ERR! gyp verb got "installVersion" 9
npm ERR! gyp verb needs "installVersion" 9
npm ERR! gyp verb install version is good
npm ERR! gyp verb get node dir target node version installed: 16.14.0
npm ERR! gyp verb build dir attempting to create "build" dir: C:\Users\whero\Desktop\新建文件夹\node_modules\node-sass\build
npm ERR! gyp verb build dir "build" dir needed to be created? C:\Users\whero\Desktop\新建文件夹\node_modules\node-sass\build
npm ERR! gyp verb Not using VS2017: Could not use PowerShell to find VS2017
npm ERR! gyp verb build/config.gypi creating config file
npm ERR! gyp verb build/config.gypi writing out config file: C:\Users\whero\Desktop\新建文件夹\node_modules\node-sass\build\config.gypi
npm ERR! (node:15712) [DEP0150] DeprecationWarning: Setting process.config is deprecated. In the future the property will be read-only.
npm ERR! (Use `node --trace-deprecation ...` to show where the warning was created)
npm ERR! gyp verb config.gypi checking for gypi file: C:\Users\whero\Desktop\新建文件夹\node_modules\node-sass\config.gypi
npm ERR! gyp verb common.gypi checking for gypi file: C:\Users\whero\Desktop\新建文件夹\node_modules\node-sass\common.gypi
npm ERR! gyp verb gyp gyp format was not specified; forcing "msvs"
npm ERR! gyp info spawn C:\Python27\python2.EXE
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   'C:\\Users\\whero\\Desktop\\新建文件夹\\node_modules\\node-gyp\\gyp\\gyp_main.py',
npm ERR! gyp info spawn args   'binding.gyp',
npm ERR! gyp info spawn args   '-f',
npm ERR! gyp info spawn args   'msvs',
npm ERR! gyp info spawn args   '-G',
npm ERR! gyp info spawn args   'msvs_version=auto',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   'C:\\Users\\whero\\Desktop\\新建文件夹\\node_modules\\node-sass\\build\\config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   'C:\\Users\\whero\\Desktop\\新建文件夹\\node_modules\\node-gyp\\addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   'C:\\Users\\whero\\.node-gyp\\16.14.0\\include\\node\\common.gypi',
npm ERR! gyp info spawn args   '-Dlibrary=shared_library',
npm ERR! gyp info spawn args   '-Dvisibility=default',
npm ERR! gyp info spawn args   '-Dnode_root_dir=C:\\Users\\whero\\.node-gyp\\16.14.0',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=C:\\Users\\whero\\Desktop\\新建文件夹\\node_modules\\node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=C:\\Users\\whero\\.node-gyp\\16.14.0\\<(target_arch)\\node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=C:\\Users\\whero\\Desktop\\新建文件夹\\node_modules\\node-sass',
npm ERR! gyp info spawn args   '-Dnode_engine=v8',
npm ERR! gyp info spawn args   '--depth=.',
npm ERR! gyp info spawn args   '--no-parallel',
npm ERR! gyp info spawn args   '--generator-output',
npm ERR! gyp info spawn args   'C:\\Users\\whero\\Desktop\\新建文件夹\\node_modules\\node-sass\\build',
npm ERR! gyp info spawn args   '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
npm ERR! Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
npm ERR! Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
npm ERR! Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
npm ERR! Traceback (most recent call last):
npm ERR!   File "C:\Users\whero\Desktop\�½��ļ���\node_modules\node-gyp\gyp\gyp_main.py", line 16, in <module>
npm ERR!     sys.exit(gyp.script_main())
npm ERR!   File "C:\Users\whero\Desktop\�½��ļ���\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 545, in script_main
npm ERR!     return main(sys.argv[1:])
npm ERR!   File "C:\Users\whero\Desktop\�½��ļ���\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 538, in main
npm ERR!     return gyp_main(args)
npm ERR!   File "C:\Users\whero\Desktop\�½��ļ���\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 523, in gyp_main
npm ERR!     generator.GenerateOutput(flat_list, targets, data, params)
npm ERR!   File "C:\Users\whero\Desktop\�½��ļ���\node_modules\node-gyp\gyp\pylib\gyp\generator\msvs.py", line 2004, in GenerateOutput
npm ERR!     generator_flags))
npm ERR!   File "C:\Users\whero\Desktop\�½��ļ���\node_modules\node-gyp\gyp\pylib\gyp\generator\msvs.py", line 943, in _GenerateProject
npm ERR!     return _GenerateMSVSProject(project, options, version, generator_flags)
npm ERR!   File "C:\Users\whero\Desktop\�½��ļ���\node_modules\node-gyp\gyp\pylib\gyp\generator\msvs.py", line 1047, in _GenerateMSVSProject
npm ERR!     p.WriteIfChanged()
npm ERR!   File "C:\Users\whero\Desktop\�½��ļ���\node_modules\node-gyp\gyp\pylib\gyp\MSVSProject.py", line 208, in WriteIfChanged
npm ERR!     encoding="Windows-1252")
npm ERR!   File "C:\Users\whero\Desktop\�½��ļ���\node_modules\node-gyp\gyp\pylib\gyp\easy_xml.py", line 122, in WriteXmlIfChanged
npm ERR!     xml_string = xml_string.decode(default_encoding).encode(encoding)
npm ERR!   File "C:\Python27\lib\encodings\cp1252.py", line 12, in encode
npm ERR!     return codecs.charmap_encode(input,errors,encoding_table)
npm ERR! UnicodeEncodeError: 'charmap' codec can't encode characters in position 7562-7566: character maps to <undefined>
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: `gyp` failed with exit code: 1
npm ERR! gyp ERR! stack     at ChildProcess.onCpExit (C:\Users\whero\Desktop\新建文件夹\node_modules\node-gyp\lib\configure.js:345:16)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:520:28)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
npm ERR! gyp ERR! System Windows_NT 10.0.19045
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\whero\\Desktop\\新建文件夹\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
npm ERR! gyp ERR! cwd C:\Users\whero\Desktop\新建文件夹\node_modules\node-sass
npm ERR! gyp ERR! node -v v16.14.0
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok
npm ERR! Build failed with error code: 1npm ERR! A complete log of this run can be found in: C:\Users\whero\AppData\Local\npm-cache\_logs\2023-05-21T02_34_21_144Z-debug-0.log

原因分析

出现这种错误通常是因为缺少编译环境或者相关依赖包没有正确安装。

问题解决

确保已经安装了 Node.js 和 npm基础上,安装 windows-build-tools
windows-build-tools 是一个针对 Windows 平台的构建环境自动安装工具,它会自动安装 Visual Studio Build Tools 和 Python 等构建所需的软件包。可以使用以下命令进行安装:

# step1
npm install --global --production windows-build-tools

注意:运行此命令需要管理员权限,如果没有管理员权限,请使用管理员身份打开命令行窗口并再次运行该命令。

这个命令会安装两个 软件

  • Visual Studio Installer
    Visual Studio Installer 是一款由 Microsoft 开发的可视化安装程序,它是 Visual Studio IDE 的一部分,旨在为开发人员提供一种方便的方式来选择和安装 Visual Studio 相关的工具和组件。
    通过 Visual Studio Installer,用户可以选择需要安装的特定模块,例如 .NET Core 开发、C++ 开发、Web 开发等,并根据自己的需求进行自定义安装。此外,它还提供了强大的配置管理功能,允许用户在多个计算机之间保存和分享安装配置。
    除了 Visual Studio IDE 本身,Visual Studio Installer 还可以用于安装其他与 Visual Studio 相关的工具和组件,例如 .NET Framework、SQL Server 数据库、Azure 开发工具等。
    总之,Visual Studio Installer 是一个非常实用的工具,它简化了 Visual Studio 工具和组件的安装和管理过程,使开发人员更加高效地进行软件开发。

  • python2

# step2: 再执行一遍
npm i

2、解析包依赖关系

报错信息:

npm ERR! code ERESOLVE ERESOLVE unable to resolve dependency tree

问题分析

npm ERR! code ERESOLVE 错误通常表示 NPM 在解析包依赖关系时遇到了问题。这个错误可能有很多原因,但通常是因为某些包的版本不兼容导致的。

问题解决

方法一:

清空 NPM 缓存,并重新安装包:

npm cache clean --force
rm -rf node_modules
npm install --force  # 一定是 强制 安装

方法二:

升级 NPM 到最新版本,并重新安装包:

npm install -g npm
rm -rf node_modules
npm install

方法三:

通过手动更改 package.json 文件来解决依赖问题。打开 package.json 文件,在 “dependencies” 或 “devDependencies” 中手动修改版本号以解决依赖问题,然后重新运行 npm install 命令。

方法四:

使用 yarn 代替 NPM 进行包管理,Yarn 的依赖解析算法通常更加健壮。你可以按照以下步骤安装 Yarn :

npm install -g yarn

相关文章:

npm i 常见问题

需要注意的是&#xff0c;如果你在使用 NPM 安装包的过程中遇到了任何问题&#xff0c;可以尝试使用 --verbose 参数打印更详细的错误信息&#xff0c;以便更好地诊断问题。例如&#xff1a; npm install --verbose 1、vue老项目缺少编译环境安装依赖报错的问题 待下载的项目…...

Prometheus+Grafana监控系统

一、简介 1、Prometheus简介 官网&#xff1a;https://prometheus.io 项目代码&#xff1a;https://github.com/prometheus Prometheus&#xff08;普罗米修斯&#xff09;是一个最初在SoundCloud上构建的监控系统。自2012年成为社区开源项目&#xff0c;拥有非常活跃的开发人员…...

基于脉冲神经网络的物体检测

访问【WRITE-BUG数字空间】_[内附完整源码和文档] 研究的意义在于探索脉冲神经网络在目标检测上的应用&#xff0c;目前主流的脉冲神经网络训练算法有直接BP训练、STDP无监督训练和训练好的ANN的转化&#xff0c;虽然训练算法众多&#xff0c;但是SNN仍然没有一套成熟的训练算…...

Rust每日一练(Leetday0010) 子串下标、两数相除、串联子串

目录 28. 找出字符串中第一个匹配项的下标 Find-the-index-of-the-first-occurrence-in-a-string &#x1f31f;&#x1f31f; 29. 两数相除 Divide Two Integers &#x1f31f;&#x1f31f; 30. 串联所有单词的子串 Substring-with-concatenation-of-all-words &#x…...

As ccess 数据库与表的操作

1. Access 数据库设计的一般步骤 . 2. 基本概念&#xff1a;Access 数据库、表、记录、字段 . 3. 使用表设计器创建表 &#xff08;1&#xff09;字段名命名规则 不能空格开头、不能用.!()[]、最长 64 个字符 &#xff08;2&#xff09;字段类型&#xff1a;文本、数字、日期/时…...

自动化的测试工具

1&#xff0c; 自动化功能测试工具&#xff1a;QTP、selenium 2&#xff0c; 自动化性能测试功能&#xff1a;LoadRunner、jmeter 3&#xff0c; 自动化接口测试工具&#xff1a;Charles、soapUI、LoadRunner、jmeter、postman、 测试工具 4&#xff0c; 测试管理工…...

Host头攻击

转载与&#xff1a;https://blog.csdn.net/weixin_47723270/article/details/129472716 01 HOST头部攻击漏洞知识 Host首部字段是HTTP/1.1新增的&#xff0c;旨在告诉服务器&#xff0c;客户端请求的主机名和端口号&#xff0c;主要用来实现虚拟主机技术。 运用虚拟主机技术&a…...

Android 12.0默认开启无障碍服务权限和打开默认apk无障碍服务

1.概述 在12.0的系统rom定制化开发中,在第三方app开发中,需要开启无障碍服务功能,就不需要在代码中开启无障碍服务了, 为了简便就需要在系统中开启无障碍服务,来实现开启无障碍服务功能 2. 默认开启无障碍服务权限和打开默认apk无障碍服务核心代码 frameworks/base/core…...

怎么成为优秀的软件工程师,而不是优秀的码农?

作为软件行业的从业者&#xff0c;每个人都希望最终成为优秀的软件工程师&#xff0c;而不仅仅是码农。一个码农只关注于编写代码和解决问题&#xff0c;而一个软件工程师则涉及到更广泛的职责和技能。 以下是一些要点&#xff0c;可以帮助你脱颖而出&#xff0c;成为一个优秀…...

安装ElasticSearch之前的准备工作jdk的安装

一.windows 下载jdk的软件 (1).进入jdk1.8官网 (2).根据电脑是32位还是64位按需下载 (3).点击下载之后就会跳转到Oracle账号登录界面 没有 Oracle账号的注册一下就可以了 下载好的jdk如下: 双击下一步下一步安装jdk 默认安装就可以了 配置环境变量 (1).电脑左下方设置选项 (2).…...

复杂数据集,召回、精度等突破方法记录【以电科院过检识别模型为参考】

目录 一、数据分析与数据集构建 二、所有相关的脚本 三、模型效果 一、数据分析与数据集构建 由于电科院数据集有17w-18w张&#xff0c;标签错误的非常多&#xff0c;且漏标非常多&#xff0c;但是所有有效时间只有半个月左右&#xff0c;显卡是M60&#xff0c;训练速度特别…...

那些你不得不会的提高工作效率的软件神器

那些你不得不会的提高工作效率的软件神器 文本编辑器 vscode 跨平台&#xff0c;插件丰富。 code-server vscode服务器版本&#xff0c;可以在浏览器中开发调试代码&#xff0c;尤其适用于windows端开发linux服务器程序。 vim linux/unix/mac终端最强大的文本编辑器。 note…...

【VMware】Ubunt 20.04时间设置

文章目录 设置本地时间 UTC8设置24小时制同步网络时间参考 Talk is cheap, show me the code. 设置本地时间 UTC8 查看当前时区状态 rootnode1:~/k8s# timedatectlLocal time: Sun 2023-05-21 15:24:02 CSTUniversal time: Sun 2023-05-21 07:24:02 UTCRTC time: Sun 2023-05-2…...

单点登录三:添加RBAC权限校验模型功能理解及实现demo

1、RBAC权限模型 RBAC&#xff08;Role-Based Access Control&#xff09;是一种基于角色的访问控制模型&#xff0c;用于管理系统中用户的权限和访问控制。它将用户、角色和权限之间的关系进行了明确的定义&#xff0c;以实现灵活的权限管理和控制。 1.1、RBAC模型主要包括以…...

基于用户认证数据构建评估模型预测认证行为风险系统(附源码)

文件说明 datasets // 数据集(训练集、测试集) feature engineering // 特征工程 models // 评估模型 测试环境 Python3.8 任务描述 项目来自系统认证风险预测https://www.datafountain.cn/competitions/537 项目完整源码下载:https://download.csdn.net/download/liu…...

本地训练中文LLaMA模型实战教程,民间羊驼模型,24G显存盘它!

羊驼实战系列索引 博文1:本地部署中文LLaMA模型实战教程,民间羊驼模型 博文2:本地训练中文LLaMA模型实战教程,民间羊驼模型(本博客) 博文3:精调训练中文LLaMA模型实战教程,民间羊驼模型(马上发布) 简介 在学习完上篇【1本地部署中文LLaMA模型实战教程,民间羊驼模…...

快速学Go依赖注入工具wire

Go相对java和C是较新的语言&#xff0c;但也有诸多优秀特性及生态库。本文介绍大多数软件工程中常用的功能&#xff1a;依赖注入。首先介绍什么是依赖注入&#xff0c;go实现库wire与其他语言的差异。然后通过简单示例实现依赖注入&#xff0c;简化代码、提升可读性。 依赖注入…...

python入门(4)流程控制语句

1. 条件判断语句 条件控制语句用于根据条件来决定程序的执行路径。在Python中&#xff0c;常见的条件控制语句有以下几种&#xff1a; &#xff08;1&#xff09;if语句&#xff1a;用于执行满足条件的代码块。示例代码&#xff1a; age 20 if age > 18:print("成年…...

【进阶】C 语言表驱动法编程原理与实践

数据压倒一切。如果选择了正确的数据结构并把一切组织的井井有条&#xff0c;正确的算法就不言自明。编程的核心是数据结构&#xff0c;而不是算法。——Rob Pike 目录 说明 概念提出 查表方式 直接查找 索引查找 分段查找 实战示例 字符统计 月天校验 名称构造 值名…...

java+springboot留学生新闻资讯网的设计与实现

Spring框架是Java平台的一个开放源代码的Full-stack(全栈)应用程序框架&#xff0c;和控制翻转容器的实现。Spring框架的一些核心功能理论&#xff0c;可以用于所有Java应用&#xff0c;Spring还为Java EE构建的Web应用提供大量的扩展支持。Spring框架没有实现任何的编程模型&a…...

AI-调查研究-01-正念冥想有用吗?对健康的影响及科学指南

点一下关注吧&#xff01;&#xff01;&#xff01;非常感谢&#xff01;&#xff01;持续更新&#xff01;&#xff01;&#xff01; &#x1f680; AI篇持续更新中&#xff01;&#xff08;长期更新&#xff09; 目前2025年06月05日更新到&#xff1a; AI炼丹日志-28 - Aud…...

基于FPGA的PID算法学习———实现PID比例控制算法

基于FPGA的PID算法学习 前言一、PID算法分析二、PID仿真分析1. PID代码2.PI代码3.P代码4.顶层5.测试文件6.仿真波形 总结 前言 学习内容&#xff1a;参考网站&#xff1a; PID算法控制 PID即&#xff1a;Proportional&#xff08;比例&#xff09;、Integral&#xff08;积分&…...

React hook之useRef

React useRef 详解 useRef 是 React 提供的一个 Hook&#xff0c;用于在函数组件中创建可变的引用对象。它在 React 开发中有多种重要用途&#xff0c;下面我将全面详细地介绍它的特性和用法。 基本概念 1. 创建 ref const refContainer useRef(initialValue);initialValu…...

2024年赣州旅游投资集团社会招聘笔试真

2024年赣州旅游投资集团社会招聘笔试真 题 ( 满 分 1 0 0 分 时 间 1 2 0 分 钟 ) 一、单选题(每题只有一个正确答案,答错、不答或多答均不得分) 1.纪要的特点不包括()。 A.概括重点 B.指导传达 C. 客观纪实 D.有言必录 【答案】: D 2.1864年,()预言了电磁波的存在,并指出…...

视频字幕质量评估的大规模细粒度基准

大家读完觉得有帮助记得关注和点赞&#xff01;&#xff01;&#xff01; 摘要 视频字幕在文本到视频生成任务中起着至关重要的作用&#xff0c;因为它们的质量直接影响所生成视频的语义连贯性和视觉保真度。尽管大型视觉-语言模型&#xff08;VLMs&#xff09;在字幕生成方面…...

Module Federation 和 Native Federation 的比较

前言 Module Federation 是 Webpack 5 引入的微前端架构方案&#xff0c;允许不同独立构建的应用在运行时动态共享模块。 Native Federation 是 Angular 官方基于 Module Federation 理念实现的专为 Angular 优化的微前端方案。 概念解析 Module Federation (模块联邦) Modul…...

OpenPrompt 和直接对提示词的嵌入向量进行训练有什么区别

OpenPrompt 和直接对提示词的嵌入向量进行训练有什么区别 直接训练提示词嵌入向量的核心区别 您提到的代码: prompt_embedding = initial_embedding.clone().requires_grad_(True) optimizer = torch.optim.Adam([prompt_embedding...

Linux离线(zip方式)安装docker

目录 基础信息操作系统信息docker信息 安装实例安装步骤示例 遇到的问题问题1&#xff1a;修改默认工作路径启动失败问题2 找不到对应组 基础信息 操作系统信息 OS版本&#xff1a;CentOS 7 64位 内核版本&#xff1a;3.10.0 相关命令&#xff1a; uname -rcat /etc/os-rele…...

纯 Java 项目(非 SpringBoot)集成 Mybatis-Plus 和 Mybatis-Plus-Join

纯 Java 项目&#xff08;非 SpringBoot&#xff09;集成 Mybatis-Plus 和 Mybatis-Plus-Join 1、依赖1.1、依赖版本1.2、pom.xml 2、代码2.1、SqlSession 构造器2.2、MybatisPlus代码生成器2.3、获取 config.yml 配置2.3.1、config.yml2.3.2、项目配置类 2.4、ftl 模板2.4.1、…...

C#学习第29天:表达式树(Expression Trees)

目录 什么是表达式树&#xff1f; 核心概念 1.表达式树的构建 2. 表达式树与Lambda表达式 3.解析和访问表达式树 4.动态条件查询 表达式树的优势 1.动态构建查询 2.LINQ 提供程序支持&#xff1a; 3.性能优化 4.元数据处理 5.代码转换和重写 适用场景 代码复杂性…...