下载了vue2的脚手架工程:https://github.com/PanJiaChen/vue-admin-template

npm install的时候出现了异常: node-sass安装报错,缺少 Python2 环境

npm ERR! code 1
npm ERR! path D:\07_project_front\online_edu_front\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:\Program Files\nodejs\node.exe D:\07_project_front\online_edu_front\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:\\Program Files\\nodejs\\node.exe',
npm ERR! gyp verb cli   'D:\\07_project_front\\online_edu_front\\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.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 (D:\07_project_front\online_edu_front\node_modules\which\which.js:13:12)
npm ERR! gyp verb `which` failed     at F (D:\07_project_front\online_edu_front\node_modules\which\which.js:68:19)
npm ERR! gyp verb `which` failed     at E (D:\07_project_front\online_edu_front\node_modules\which\which.js:80:29)
npm ERR! gyp verb `which` failed     at D:\07_project_front\online_edu_front\node_modules\which\which.js:89:16
npm ERR! gyp verb `which` failed     at D:\07_project_front\online_edu_front\node_modules\isexe\index.js:42:5
npm ERR! gyp verb `which` failed     at D:\07_project_front\online_edu_front\node_modules\isexe\windows.js:36:5
npm ERR! gyp verb `which` failed     at FSReqCallback.oncomplete (node:fs:198:21)
npm ERR! gyp verb `which` failed  python2 Error: not found: python2
npm ERR! gyp verb `which` failed     at getNotFoundError (D:\07_project_front\online_edu_front\node_modules\which\which.js:13:12)
npm ERR! gyp verb `which` failed     at F (D:\07_project_front\online_edu_front\node_modules\which\which.js:68:19)
npm ERR! gyp verb `which` failed     at E (D:\07_project_front\online_edu_front\node_modules\which\which.js:80:29)
npm ERR! gyp verb `which` failed     at D:\07_project_front\online_edu_front\node_modules\which\which.js:89:16
npm ERR! gyp verb `which` failed     at D:\07_project_front\online_edu_front\node_modules\isexe\index.js:42:5
npm ERR! gyp verb `which` failed     at D:\07_project_front\online_edu_front\node_modules\isexe\windows.js:36:5
npm ERR! gyp verb `which` failed     at FSReqCallback.oncomplete (node:fs:198: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:\Program Files (x86)\python\python.EXE
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Command failed: D:\Program Files (x86)\python\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! command "D:\\Program Files\\nodejs\\node.exe" "D:\\07_project_front\\online_edu_front\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
npm ERR! gyp ERR! cwd D:\07_project_front\online_edu_front\node_modules\node-sass
npm ERR! gyp ERR! node -v v16.14.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\xhh\AppData\Local\npm-cache\_logs\2022-11-22T08_06_47_369Z-debug-0.log

初步分析是缺少python2环境,安装后还是没用。

实际是 node-sass的版本太低了,更新至

"node-sass": "^6.0.1"

重新 npm install ,问题解决。

npm ERR! gyp verb check python checking for Python executable “python2“ in the PATH相关推荐

  1. npm ERR! gyp verb等一系列错

    npm ERR! code 1 npm ERR! path F:\新桌面\大三下\生产实习\mock-devices-master\mock-devices-master\node_modules\n ...

  2. npm install 报错 gyp info it worked if it ends with ok npm ERR! gyp verb cli [

    今天新启动一个项目,在 npm install 安装依赖项时出现报错. ERR! code 1 npm ERR! path C:\Users\Administrator\Desktop\14531\m ...

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

    gyp 报错 not found:python2 在使用vue-cli创建vue3项目时,安装依赖时,报错 npm ERR! gyp verb check python checking for Py ...

  4. npm install 报错 gyp info it worked if it ends with ok npm ERR gyp verb cli [

    今天新启动一个项目,在 npm install 安装依赖项时出现报错. ERR! code 1 npm ERR! path C:UsersAdministratorDesktope31mall-adm ...

  5. npm install 报错 ERR! gyp ERR! cwd D:\workspace\node_modules\node-sass错误解决/npm ERR! gyp verb `which

    一.问题描述: npm install 报错 ERR! gyp ERR! cwd D:\workspace\node_modules\node-sass 二.可能原因 nodejs与sass版本不匹配 ...

  6. 项目场景: gyp verb check python checking for Python executable python2 in the PATH

    项目场景: gyp verb check python checking for Python executable "python2" in the PATH 环境 ​ node ...

  7. 【环境篇 npm 报错】npm ERR gyp ERR stack import sys; print “%s.%s.%s“ % sys.version_info[:3];

    问题描述 npm ERR! code 1 npm ERR! path D:\user\Desktop\NiSown\node_modules\node-sass npm ERR! command fa ...

  8. gyp verb check python checking for Python executable “python2“ in the PATH

    gyp verb check python checking for Python executable "python2" in the PATH 缺少python2.7支持 可 ...

  9. npm install 报错 check python checking for Python executable python2 in the PATH

    当npm install 的时候,报如下错误: Building: G:\nodejs\node.exe F:\test\node_modules\node-gyp\bin\node-gyp.js r ...

最新文章

  1. u盘读写测试_关于闪迪u盘cz880速度测试
  2. Cocos2d JS 之消灭星星(九) 处理星星类之——移动和消灭星星
  3. EPG组合 (Exporter Prometheus Grafana) 监控MySQL
  4. 中国电网招聘 计算机岗位
  5. 面板Ext.Panel使用
  6. linux系统怎么删除打印机,解决LINUX ES3.0下想指定打印机和用户的删除打印作业的问题...
  7. 如何从程序员转型为项目经理
  8. python封装成exe后运行失败_python 在编译成EXE 文件后报错 我实在是找不出原因
  9. 第三章 Docker 入门
  10. RxJava Observer与Subscriber的关系
  11. m3u8格式转MP4(ffmpeg方法)
  12. 【致青春】奋斗迷茫的我们
  13. get请求图片出现403 防盗链解决方式 no-referrer
  14. 深入理解 AuthenticationManagerBuilder 【源码篇】
  15. PHP把html代码转换成普通字符串,在页面中显示
  16. SEO外链策略之链接诱饵的制作需知
  17. heritrix mysql_heritrix的简单使用以及在后台调用heritrix
  18. 科技爱好者周刊(第 134 期):未来的游戏业比现在大100倍
  19. office办公软件有哪些:试试OnlyOffice(Office办公软件)官网中文版吧 | 使用简单无需onlyoffice使用教程
  20. Python List列表函数大全

热门文章

  1. “云脑启智 开源赋能”2021年度AI盛会召开 PNEdit赋能人工智能产业发展
  2. Toasts官方教程
  3. 大学计算机期末总结范文,大学计算机课期末总结.doc
  4. 【操作系统】LinuxKernel-VFS虚拟文件系统 认知框架构建(super_block,inode,dentry,file)
  5. 前端:JavaScript (五)XML DOM
  6. python里面bif是啥意思_什么是BIF?
  7. Comparable和Comparator接口
  8. JD token解密之旅
  9. @Around简单使用示例——SpringAOP增强处理
  10. 大数据核心32个算法技术