mall-admin-web-master前端项目下载依赖失败解决

devtools/2024/9/22 16:52:03/

碰壁后的总结

  1. pythone 环境 2.XX版本,切记不要3.0以上的。
  2. node 16.x不能太高

错误案例

npm ERR! code 1
npm ERR! path D:\workspace\springBootMall\mall-admin-web-master\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: D:\APPS\nvm\nodejs\node.exe D:\workspace\springBootMall\mall-admin-web-master\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   'D:\\APPS\\nvm\\nodejs\\node.exe',
npm ERR! gyp verb cli   'D:\\workspace\\springBootMall\\mall-admin-web-master\\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@7.1.2
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 find Python Python is not set from command line or npm configuration
npm ERR! gyp verb find Python Python is not set from environment variable PYTHON
npm ERR! gyp verb find Python checking if "python3" can be used
npm ERR! gyp verb find Python - executing "python3" to get executable path
npm ERR! gyp verb find Python - "python3" is not in PATH or produced an error
npm ERR! gyp verb find Python checking if "python" can be used
npm ERR! gyp verb find Python - executing "python" to get executable path
npm ERR! gyp verb find Python - "python" is not in PATH or produced an error
npm ERR! gyp verb find Python checking if "python2" can be used
npm ERR! gyp verb find Python - executing "python2" to get executable path
npm ERR! gyp verb find Python - "python2" is not in PATH or produced an error
npm ERR! gyp verb find Python checking if Python is C:\Python37\python.exe
npm ERR! gyp verb find Python - executing "C:\Python37\python.exe" to get version
npm ERR! gyp verb find Python - "C:\Python37\python.exe" could not be run
npm ERR! gyp verb find Python checking if Python is C:\Python27\python.exe
npm ERR! gyp verb find Python - executing "C:\Python27\python.exe" to get version
npm ERR! gyp verb find Python - "C:\Python27\python.exe" could not be run
npm ERR! gyp verb find Python checking if the py launcher can be used to find Python
npm ERR! gyp verb find Python - executing "py.exe" to get Python executable path
npm ERR! gyp verb find Python - "py.exe" is not in PATH or produced an error
npm ERR! gyp ERR! find Python
npm ERR! gyp ERR! find Python Python is not set from command line or npm configuration
npm ERR! gyp ERR! find Python Python is not set from environment variable PYTHON
npm ERR! gyp ERR! find Python checking if "python3" can be used
npm ERR! gyp ERR! find Python - "python3" is not in PATH or produced an error
npm ERR! gyp ERR! find Python checking if "python" can be used
npm ERR! gyp ERR! find Python - "python" is not in PATH or produced an error
npm ERR! gyp ERR! find Python checking if "python2" can be used
npm ERR! gyp ERR! find Python - "python2" is not in PATH or produced an error
npm ERR! gyp ERR! find Python checking if Python is C:\Python37\python.exe
npm ERR! gyp ERR! find Python - "C:\Python37\python.exe" could not be run
npm ERR! gyp ERR! find Python checking if Python is C:\Python27\python.exe
npm ERR! gyp ERR! find Python - "C:\Python27\python.exe" could not be run
npm ERR! gyp ERR! find Python checking if the py launcher can be used to find Python
npm ERR! gyp ERR! find Python - "py.exe" is not in PATH or produced an error
npm ERR! gyp ERR! find Python
npm ERR! gyp ERR! find Python **********************************************************
npm ERR! gyp ERR! find Python You need to install the latest version of Python.
npm ERR! gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
npm ERR! gyp ERR! find Python you can try one of the following options:
npm ERR! gyp ERR! find Python - Use the switch --python="C:\Path\To\python.exe"
npm ERR! gyp ERR! find Python   (accepted by both node-gyp and npm)
npm ERR! gyp ERR! find Python - Set the environment variable PYTHON
npm ERR! gyp ERR! find Python - Set the npm configuration variable python:
npm ERR! gyp ERR! find Python   npm config set python "C:\Path\To\python.exe"
npm ERR! gyp ERR! find Python For more information consult the documentation at:
npm ERR! gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
npm ERR! gyp ERR! find Python **********************************************************
npm ERR! gyp ERR! find Python
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Could not find any Python installation to use
npm ERR! gyp ERR! stack     at PythonFinder.fail (D:\workspace\springBootMall\mall-admin-web-master\node_modules\node-gyp\lib\find-python.js:302:47)
npm ERR! gyp ERR! stack     at PythonFinder.runChecks (D:\workspace\springBootMall\mall-admin-web-master\node_modules\node-gyp\lib\find-python.js:136:21)
npm ERR! gyp ERR! stack     at PythonFinder.<anonymous> (D:\workspace\springBootMall\mall-admin-web-master\node_modules\node-gyp\lib\find-python.js:200:18)
npm ERR! gyp ERR! stack     at PythonFinder.execFileCallback (D:\workspace\springBootMall\mall-admin-web-master\node_modules\node-gyp\lib\find-python.js:266:16)
npm ERR! gyp ERR! stack     at exithandler (node:child_process:410:5)
npm ERR! gyp ERR! stack     at ChildProcess.errorhandler (node:child_process:422:5)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
npm ERR! gyp ERR! stack     at onErrorNT (node:internal/child_process:485:16)
npm ERR! gyp ERR! stack     at processTicksAndRejections (node:internal/process/task_queues:83:21)
npm ERR! gyp ERR! System Windows_NT 10.0.22621
npm ERR! gyp ERR! command "D:\\APPS\\nvm\\nodejs\\node.exe" "D:\\workspace\\springBootMall\\mall-admin-web-master\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
npm ERR! gyp ERR! cwd D:\workspace\springBootMall\mall-admin-web-master\node_modules\node-sass
npm ERR! gyp ERR! node -v v16.20.2
npm ERR! gyp ERR! node-gyp -v v7.1.2
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:
npm ERR!     D:\APPS\ToolApp\node16\node_cache\_logs\2024-08-13T14_50_26_564Z-debug-0.log

解决 :

1.删除当前依赖包

npm uninstall node-sass sass-loader

2.下载如下版本

npm i node-sass@6.0.1 sass-loader@7.0.3

3.如果下载失败,可能是网络问题,换一个源

npm set sass_binary_site http://cdn.npm.taobao.org/dist/node-sass

4.下载依赖

npm install

5.运行

npm run dev

http://www.ppmy.cn/devtools/96309.html

相关文章

工厂模式和策略模式的区别以及使用

在软件开发中&#xff0c;设计模式提供了行之有效的解决方案&#xff0c;用来应对常见的设计问题。其中&#xff0c;工厂模式&#xff08;Factory Pattern&#xff09;和策略模式&#xff08;Strategy Pattern&#xff09;是两种重要且常用的设计模式。虽然它们都涉及到对象的创…

kafka运维常用命令

KAFKA常用命令 一、KAFKA常用命令1.1kafka造数1.2kafla抓包1.2.1实时查看kafka数据1.2.2查看kafka历史数据1.2.3查看kafka中带有某个ip的历史数据1.2.4将kafka数据存入文件中 一、KAFKA常用命令 1.1kafka造数 示例&#xff1a;给topic为 ids-test 造数 ./kafka-console-produ…

木舟0基础学习Java的第二十四天(CSS,JS,Jquery)

CSS 内部样式&#xff1a; 标签选择器&#xff1a;直接应用于HTML标签 类选择器&#xff1a;可以在页面当中多次使用 id选择器&#xff1a;同一个id选择器在同一页面中只能调用一次 选择器优先级&#xff1a;id选择器>类选择器>标签选择器 html <!DOCTYPE htm…

培训学校课程管理系统-计算机毕设Java|springboot实战项目

&#x1f34a;作者&#xff1a;计算机毕设匠心工作室 &#x1f34a;简介&#xff1a;毕业后就一直专业从事计算机软件程序开发&#xff0c;至今也有8年工作经验。擅长Java、Python、微信小程序、安卓、大数据、PHP、.NET|C#、Golang等。 擅长&#xff1a;按照需求定制化开发项目…

uniapp-部分文件中文乱码

一、问题 在开发时遇到&#xff0c;部分页面的中文显示乱码&#xff0c;如图 搜索了一下解决方法&#xff0c;这里记录一下 二、问题原因&#xff1a; 页面的编码格式不是 utf-8 造成的 三、解决方法 打开出现乱码页面选择编译器左上角的文件 > 以指定编码重新打开 选择U…

React状态管理:react-redux和redux-saga(适合由vue转到react的同学)

注意&#xff1a;本文不会把所有知识点都写一遍&#xff0c;并不适合纯新手阅读 首先Redux是一种状态管理方案&#xff0c;本身和react并没有什么联系&#xff0c;redux也可以结合其他框架来用。 react-redux是基于react的一种状态管理实现&#xff0c;他不像vuex那样直接内置在…

WO Mic 手机变身免费麦克风

目录 一、主要特点 1.支持多种连接方式 2.应用广泛 3.低延迟 4.简易配置 5.自动连接 6.音频格式 二、软件下载 三、软件安装 四、系统连接 五、测试 直播的时候,上课的时候,会议的时候……突然发现没有麦克风或者电脑麦克风有故障,这可怎么办呢?今天给大家介绍一…

计算机毕业设计选题推荐-医院问诊系统-Java/Python项目实战

✨作者主页&#xff1a;IT毕设梦工厂✨ 个人简介&#xff1a;曾从事计算机专业培训教学&#xff0c;擅长Java、Python、微信小程序、Golang、安卓Android等项目实战。接项目定制开发、代码讲解、答辩教学、文档编写、降重等。 ☑文末获取源码☑ 精彩专栏推荐⬇⬇⬇ Java项目 Py…