windows系统nodeJs报错node-sass npm ERR! command failed

报错信息

npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated tar@2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.
npm WARN deprecated 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.
npm ERR! code 1
npm ERR! path E:\ideawork_my\时光序页面\records\node_modules\vue-mindmap\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: E:\ideawork_my\时光序页面\records\node_modules\node\bin\node.exe E:\ideawork_my\时光序页面\records\node_modules\vue-mindmap\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   'E:\\ideawork_my\\时光序页面\\records\\node_modules\\node\\bin\\node.exe',
npm ERR! gyp verb cli   'E:\\ideawork_my\\时光序页面\\records\\node_modules\\vue-mindmap\\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.20.2 | 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` failed Error: not found: python2
npm ERR! gyp verb `which` failed     at getNotFoundError (E:\ideawork_my\时光序页面\records\node_modules\vue-mindmap\node_modules\which\which.js:13:12)
npm ERR! gyp verb `which` failed     at F (E:\ideawork_my\时光序页面\records\node_modules\vue-mindmap\node_modules\which\which.js:68:19)
npm ERR! gyp verb `which` failed     at E (E:\ideawork_my\时光序页面\records\node_modules\vue-mindmap\node_modules\which\which.js:80:29)
npm ERR! gyp verb `which` failed     at E:\ideawork_my\时光序页面\records\node_modules\vue-mindmap\node_modules\which\which.js:89:16
npm ERR! gyp verb `which` failed     at E:\ideawork_my\时光序页面\records\node_modules\isexe\index.js:42:5
npm ERR! gyp verb `which` failed     at E:\ideawork_my\时光序页面\records\node_modules\isexe\windows.js:36:5
npm ERR! gyp verb `which` failed     at FSReqCallback.oncomplete (node:fs:202:21)
npm ERR! gyp verb `which` failed  python2 Error: not found: python2
npm ERR! gyp verb `which` failed     at getNotFoundError (E:\ideawork_my\时光序页面\records\node_modules\vue-mindmap\node_modules\which\which.js:13:12)
npm ERR! gyp verb `which` failed     at F (E:\ideawork_my\时光序页面\records\node_modules\vue-mindmap\node_modules\which\which.js:68:19)
npm ERR! gyp verb `which` failed     at E (E:\ideawork_my\时光序页面\records\node_modules\vue-mindmap\node_modules\which\which.js:80:29)
npm ERR! gyp verb `which` failed     at E:\ideawork_my\时光序页面\records\node_modules\vue-mindmap\node_modules\which\which.js:89:16
npm ERR! gyp verb `which` failed     at E:\ideawork_my\时光序页面\records\node_modules\isexe\index.js:42:5
npm ERR! gyp verb `which` failed     at E:\ideawork_my\时光序页面\records\node_modules\isexe\windows.js:36:5
npm ERR! gyp verb `which` failed     at FSReqCallback.oncomplete (node:fs:202:21) {
npm ERR! gyp verb `which` failed   code: 'ENOENT'
npm ERR! gyp verb `which` failed }
npm ERR! gyp verb check python checking for Python executable "python" in the PATH
npm ERR! gyp verb `which` succeeded python D:\Python\Python38\python.EXE
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Command failed: D:\Python\Python38\python.EXE -c import sys; print "%s.%s.%s" % sys.version_info[:3];
npm ERR! gyp ERR! stack   File "<string>", line 1
npm ERR! gyp ERR! stack     import sys; print "%s.%s.%s" % sys.version_info[:3];
npm ERR! gyp ERR! stack                       ^
npm ERR! gyp ERR! stack SyntaxError: invalid syntax
npm ERR! gyp ERR! stack
npm ERR! gyp ERR! stack     at ChildProcess.exithandler (node:child_process:402:12)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
npm ERR! gyp ERR! stack     at maybeClose (node:internal/child_process:1100:16)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5)
npm ERR! gyp ERR! System Windows_NT 10.0.22621
npm ERR! gyp ERR! command "E:\\ideawork_my\\时光序页面\\records\\node_modules\\node\\bin\\node.exe" "E:\\ideawork_my\\时光序页面\\records\\node_modules\\vue-mindmap\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
npm ERR! gyp ERR! cwd E:\ideawork_my\时光序页面\records\node_modules\vue-mindmap\node_modules\node-sass
npm ERR! gyp ERR! node -v v16.20.2
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok
npm ERR! Build failed with error code: 1

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\dell\AppData\Local\npm-cache\_logs\2023-12-08T06_56_00_079Z-debug-0.log

以 python2.7安装

npm install node-sass --python=python2.7 
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: undefined@undefined
npm ERR! Found: vue@3.3.11
npm ERR! node_modules/vue
npm ERR!   vue@"^3.3.4" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer vue@"^2.6.14" from @wangeditor/editor-for-vue@1.0.2
npm ERR! node_modules/@wangeditor/editor-for-vue
npm ERR!   @wangeditor/editor-for-vue@"^1.0.2" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See C:\Users\dell\AppData\Local\npm-cache\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\dell\AppData\Local\npm-cache\_logs\2023-12-08T07_02_58_989Z-debug-0.log

升级Node

https://nodejs.org/en/download/

在这里插入图片描述
下载最新版本解压覆盖之前的版本

忘记之前在哪个位置 可通过 where node

安装cnpm

1、安装cnpm,输入以下命令:

npm install -g cnpm --registry=http://registry.npm.taobao.org

注意:为了避免每次安装都需要–registry参数,可以使用如下命令

进行永久设置:npm config set registry http://registry.npm.taobao.org

重新安装node-sass

根据报错信息 得出是node-sass的版本问题
更新 node-sass

node-sass和node的版本对照: https://www.npmjs.com/package/node-sass

后续参考:
https://blog.csdn.net/qq_37974755/article/details/124604371?utm_medium=distribute.pc_relevant.none-task-blog-2defaultbaidujs_baidulandingword~default-4-124604371-blog-133519851.235v39pc_relevant_default_base&spm=1001.2101.3001.4242.3&utm_relevant_index=7

或者

如果node是最新版本,则可以直接使用以下命令安装即可
npm install sass-loader node-sass --save-dev

cnpm install sass-loader node-sass --save-dev

如果node不是最新版本,则需要安装对应的版本号才行
npm install sass-loader@版本号 node-sass@版本号 --save-dev //安装对应的版本

cnpm install sass-loader@版本号 node-sass@版本号 --save-dev //安装对应的版本

卸载安装低版本Node

npm install –save-dev node-sass – force

https://www.iotword.com/16158.html

卸载python

根据报错信息

npm ERR! gyp verb `which` failed  python2 Error: not found: python2

可以执行以下命令试试
npm install node-sass --python=python2.7 --force

由于我本机python环境是3.8.4
一直报错找不到python2 索性卸载了 python

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

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

英文作文AI创作工具,怎么用AI批量写英文作文

在当今全球化的时代&#xff0c;良好的英语写作能力不仅仅是学业成功的关键&#xff0c;更是职场竞争中的重要技能。随着科技的不断发展&#xff0c;我们现在有了更多的工具可以辅助我们提升英语写作水平。在这篇文章中&#xff0c;我将为大家推荐5种强大的AI写作工具&#xff…

C++基础 -42- STL库之list链表

———————STL库之list链表——————— &#x1f384; list链表的格式(需要定义头文件) list<int> data1(4, 100);list<int> data2(4, 500);&#x1f384;list链表的合并接口 &#x1f384;举例使用合并接口并且验证 data2.merge(data1);list<int>::…

探索低代码的潜力、挑战与未来展望

低代码开发作为一种新兴的开发方式&#xff0c;正在逐渐改变着传统的编程模式&#xff0c;低代码使得开发者无需编写大量的代码即可快速构建各种应用程序。然而&#xff0c;低代码也引发了一系列争议&#xff0c;有人称赞其为提升效率的利器&#xff0c;也有人担忧其可能带来的…

大数据毕业设计之前端02:架构布局和aside的设计

前言 上一篇主要讲了我学习前端的一个经历&#xff0c;以及为什么选择BuildAdmin作为深入前端学习的原因.同事也大致聊了一下学习前端需要使用哪些技术栈。 本篇文章来拆解一下BuildAdmin的前端代码结构&#xff0c;和布局实现的细节。 前端代码结构 必须先了解项目的结构&…

2.vue学习笔记(目录结构+模板语法+属性绑定)

1.目录结构 1.vscode ——VSCode工具的配置文件夹 2.node_modules ——Vue项目的运行依赖文件夹 3.public ——资源文件夹&#xff08;浏览器图标&#xff09; 4.src ——源码文件夹 5..gitgnore ——git忽略文件 6.index.html ——如果html文件 7.package.json —…

两数之和(map结构解决)

/*** param {number[]} nums* param {number} target* return {number[]}*/ var twoSum function(nums, target) {let mapIds new Map()for (const [index, item] of nums.entries()) {// 利用map结构不重复的特点&#xff0c;用目标值减去当前值&#xff0c;也就是 9-27// 然…

如何进行代码混淆?方法与常见工具介绍

​ 如何进行代码混淆&#xff1f;方法与常见工具介绍 目录 什么是代码混淆&#xff1f; 代码混淆的方法 常见代码混淆工具 什么是代码混淆&#xff1f; 代码混淆是指将计算机程序的代码转换成一种功能上等价&#xff0c;但难于阅读和理解的形式的行为。混淆后的代码很难被…

P2 Qt Creator创建第一个Qt程序

前言 &#x1f3ac; 个人主页&#xff1a;ChenPi &#x1f43b;推荐专栏1: 《C_ChenPi的博客-CSDN博客》✨✨✨ &#x1f525; 推荐专栏2: 《LLinux C应用编程&#xff08;概念类&#xff09;_ChenPi的博客-CSDN博客》✨✨✨ &#x1f33a;本篇简介 &#xff1a;这一章我们学…

远程调试Linux服务器上的代码

远程调试Linux服务器上的代码 首先我们的环境有本地环境还有研发环境&#xff0c;本地环境就是我们本地电脑上面的代码&#xff0c;而研发环境就是我们开发好一个功能&#xff0c;发到一个linux服务器上面的代码&#xff1b;但是有些时候&#xff0c;研发环境上面的代码可能会…

实时视频美颜:美颜SDK选择指南与性能比较

如今&#xff0c;实时视频美颜技术逐渐成为开发者和用户关注的焦点。本文将通过探讨美颜SDK的选择指南以及性能比较&#xff0c;开发者们可以作为参考&#xff0c;以此选择更合适的美颜SDK。 一、美颜SDK的选择指南 1.1目标应用场景 在选择美颜SDK之前&#xff0c;首先需要…

打工人副业变现秘籍,某多/某手变现底层引擎-StableDiffusion模型下载使用

一、模型的概念 首先要了解 Stable Diffusion 中的模型概念是什么?维基百科对模型的定义非常简单:用一个较为简单的东西来代表另一个东西。换句话说,模型代表的是对某一种事物的抽象表达。 在 AIGC 领域,为了使机器表现出智能,研发人员使用机器学习的方式让计算机从数据中…

Cloak斗篷技术不知道?超实用干货,FP商家必读!

都2023年了&#xff0c;还有很多人犹豫要不要入局独立站。心动不如行动&#xff0c;如果想要在跨境独立站中干出一番新事业&#xff0c;要赶紧动起来。部分卖家在出海初期&#xff0c;都想着出售FP产品&#xff0c;涉及到FP产品&#xff0c;各大主流平台上都有严格的审核机制&a…

生产上线需要注意的安全漏洞

一、关闭swagger 1、关闭swagger v3 # 需同时设置auto-startupfalse&#xff0c;否则/v3/api-docs等接口仍能继续访问 springfox:documentation:enabled: falseauto-startup: falseswagger-ui:enabled: false 2、关闭swagger v2 # 只要不是true就不启用 swagger:enable: fa…

【面试经典150 | 二叉树】相同的树

文章目录 写在前面Tag题目来源题目解读解题思路方法一&#xff1a;递归方法二&#xff1a;迭代 写在最后 写在前面 本专栏专注于分析与讲解【面试经典150】算法&#xff0c;两到三天更新一篇文章&#xff0c;欢迎催更…… 专栏内容以分析题目为主&#xff0c;并附带一些对于本题…

python深浅拷贝

【 一 】Python 深拷贝和浅拷贝概念理解 个人见解&#xff1a; 浅拷贝&#xff0c;指的是重新分配一块内存&#xff0c;创建一个新的对象&#xff0c;但里面的元素是原对象中各个子对象的引用。 深拷贝&#xff0c;是指重新分配一块内存&#xff0c;创建一个新的对象&…

Post Quantum Fuzzy Stealth Signatures and Applications

目录 笔记后续的研究方向摘要引言贡献模块化框架模糊构造实施适用于FIDO Post Quantum Fuzzy Stealth Signatures and Applications CCS 2023 笔记 后续的研究方向 摘要 自比特币问世以来&#xff0c;基于区块链的加密货币中的私人支付一直是学术和工业研究的主题。隐形地址…

elasticsearch 内网下如何以离线的方式上传任意的huggingFace上的NLP模型(国内避坑指南)

es自2020年的8.x版本以来&#xff0c;就提供了机器学习的能力。我们可以使用es官方提供的工具eland&#xff0c;将hugging face上的NLP模型&#xff0c;上传到es集群中。利用es的机器学习模块&#xff0c;来运维部署管理模型。配合es的管道处理&#xff0c;来更加便捷的处理数据…

DSGN:用于 3D 目标检测的深度立体几何网络

论文地址&#xff1a;https://www.jianshu.com/go-wild?ac2&urlhttps%3A%2F%2Farxiv.org%2Fpdf%2F2001.03398v3.pdf 论文代码&#xff1a;https://github.com/chenyilun95/DSGN 论文背景 大多数最先进的 3D 物体检测器严重依赖 LiDAR 传感器&#xff0c;因为基于图像的方…

IDEA中表明或者字段找不到时报红

问题 idea 中mysql的sql语句报红&#xff0c;无论表名还是表字段 原因 是由于sql方言导致的 当我们选择某一个sql方言的时候&#xff0c;xml配置会按照指定规则校验sql是否规范&#xff0c;并给出提示 解决方案 取消sql方言&#xff0c;设置sql方言为None。设置完重启idea既…

理解网络通信中的关键因素-带宽

在今天的数字时代&#xff0c;我们经常听到“带宽”的词汇&#xff0c;尤其是在谈论互联网速度、网络连接和数据传输时。带宽是网络通信的关键概念&#xff0c;对于我们的在线体验至关重要。 带宽的定义 带宽是一个用于描述网络通信速度和容量的术语。它通常用于衡量网络连接…