【NMP笔记】 npm ERR! find Python 异常

Python - gyp verb find Python Python is not set from command line or npm configuration 安装node-sass@^5.0.0时报错如下 npm ERR! code 1 npm ERR! path C:\Users\m300381\Projects\nuxt\nuxt-001\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\ 阅读详情

错误异常

 ERR! find Python 
gyp ERR! find Python Python is not set from command line or npm configuration
gyp ERR! find Python Python is not set from environment variable PYTHON
gyp ERR! find Python checking if "python" can be used
gyp ERR! find Python - "python" is not in PATH or produced an error
gyp ERR! find Python checking if "python2" can be used
gyp ERR! find Python - "python2" is not in PATH or produced an error
gyp ERR! find Python checking if "python3" can be used
gyp ERR! find Python - "python3" is not in PATH or produced an error
gyp ERR! find Python checking if the py launcher can be used to find Python 2
gyp ERR! find Python - "py.exe" is not in PATH or produced an error
gyp ERR! find Python checking if Python is C:\Python27\python.exe
gyp ERR! find Python - "C:\Python27\python.exe" could not be run
gyp ERR! find Python checking if Python is C:\Python37\python.exe
gyp ERR! find Python - "C:\Python37\python.exe" could not be run
gyp ERR! find Python
gyp ERR! find Python **********************************************************
gyp ERR! find Python You need to install the latest version of Python.
gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
gyp ERR! find Python you can try one of the following options:
gyp ERR! find Python - Use the switch --python="C:\Path\To\python.exe"
gyp ERR! find Python   (accepted by both node-gyp and npm)
gyp ERR! find Python - Set the environment variable PYTHON
gyp ERR! find Python - Set the npm configuration variable python:
gyp ERR! find Python   npm config set python "C:\Path\To\python.exe"
gyp ERR! find Python For more information consult the documentation at:
gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
gyp ERR! find Python **********************************************************
gyp ERR! find Python
gyp ERR! configure error
gyp ERR! stack Error: Could not find any Python installation to use
gyp ERR! stack     at PythonFinder.fail (C:\Users\DELL\AppData\Roaming\nvm\v14.18.1\node_modules\npm\node_modules\node-gyp\lib\find-python.js:307:47)
gyp ERR! stack     at PythonFinder.runChecks (C:\Users\DELL\AppData\Roaming\nvm\v14.18.1\node_modules\npm\node_modules\node-gyp\lib\find-python.js:136:21)
gyp ERR! stack     at PythonFinder.<anonymous> (C:\Users\DELL\AppData\Roaming\nvm\v14.18.1\node_modules\npm\node_modules\node-gyp\lib\find-python.js:225:16)
gyp ERR! stack     at PythonFinder.execFileCallback (C:\Users\DELL\AppData\Roaming\nvm\v14.18.1\node_modules\npm\node_modules\node-gyp\lib\find-python.js:271:16)
gyp ERR! stack     at exithandler (child_process.js:390:5)
gyp ERR! stack     at ChildProcess.errorhandler (child_process.js:402:5)
gyp ERR! stack     at ChildProcess.emit (events.js:400:28)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:280:12)
gyp ERR! stack     at onErrorNT (internal/child_process.js:469:16)
gyp ERR! stack     at processTicksAndRejections (internal/process/task_queues.js:82:21)
gyp ERR! System Windows_NT 10.0.22000
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\DELL\\AppData\\Roaming\\nvm\\v14.18.1\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd D:\project\SysMocap\node_modules\@seorii\win32-displayconfig
gyp ERR! node -v v14.18.1
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @seorii/win32-displayconfig@0.1.1 rebuild: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @seorii/win32-displayconfig@0.1.1 rebuild script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\DELL\AppData\Roaming\npm-cache\_logs\2022-09-23T03_08_48_305Z-debug.log
npm WARN @pixiv/three-vrm@0.6.11 requires a peer of @types/three@^0.137.0 but none is installed. You must install peer dependencies yourself.
npm WARN svelte-awesome@3.0.0 requires a peer of svelte@^3.43.1 but none is installed. You must install peer dependencies yourself.
npm WARN svelte-simple-modal@1.4.1 requires a peer of svelte@^3.31.2 but none is installed. You must install peer dependencies yourself.
npm WARN sysmocap@0.5.7 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fs-xattr@0.3.1 (node_modules\fs-xattr):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fs-xattr@0.3.1: wanted {"os":"!win32","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.2 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: macos-alias@0.2.11 (node_modules\macos-alias):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for macos-alias@0.2.11: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: appdmg@0.6.4 (node_modules\appdmg):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for appdmg@0.6.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @seorii/win32-displayconfig@0.1.1 install: `npm run rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @seorii/win32-displayconfig@0.1.1 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\DELL\AppData\Roaming\npm-cache\_logs\2022-09-23T03_08_48_638Z-debug.log

解决方法:

1.安装node-gyp

npm install -g node-gyp

2.安装python

推荐安装2.7版本(自行选择32位或者64位安装):

https://www.python.org/downlo...vue

若是官网下载速度很慢,可使用另外一种安装方式node

以管理员身份执行python
npm install --global --production windows-build-tools

在这里插入图片描述

安装完成后会在C:WindowsSystem32里找到一个名为.windows-build-tools的文件夹
在这里插入图片描述
能够直接按照这个目录配置环境,为了方便,我选择将python27重装到D盘,点击python-2.7.15.amd64.msi选择
image.pnggit

移除以后再点击setup程序,此次能够直接安装
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

安装成功后,在命令行界面输入python测试是否安装成功
在这里插入图片描述

3.配置环境变量

环境变量->系统环境变量->Path
image.pngwindows

4.npm 配置

npm config set python "D:\Python27\python.exe"
npm config set node_gyp "D:\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js"

配置成功后,再次运行npm install就不会报错了测试

记一次vue安装模块报 gyp ERR! find Python vue安装模块报gyp ERR! find Python解决方案 阅读详情

相关推荐

Python is not set from command line or npm configuration 报错解决

npm install 的过程中提示 Python is not set from command line or npm configuration 的报错,相信不少朋友都遇到过,出现这个问题的原因是缺少 python 环境所导致的。

jiangjunyuan168的博客 3199

gyp ERR find Python 解决方案

可以直接按照这个目录配置环境

m0_59485658的博客 9763

node启动前端项目报错

node启动前端项目报错,请大佬进来帮忙看看 D:\HBuilderProjects\SvnProject>npm install npm ERR! code 1 npm ERR! path D:\HBuilderProjects\SvnProject\node_modules\deasync npm ERR! command failed npm ERR! command C:\Windows\system32\cmd.exe /d /s /c node ./build.js npm ERR! gy

qq_42387816的博客 2214

npm安装报错找不到python、c++等:npm ERR! gyp

问题描述 运行npm i 安装依赖包时,npm报错: npm ERR! gyp info using node-gyp08.4.1 npm ERR! gyp info using node@16.14.2 I win32 |×64 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

云帆的博客 7361

【ipfs-api】gyp ERR! find Python.

在执行npm install --saveipfs-api命令的时候,出现以下错误: gyp ERR! find Python gyp ERR! find Python Python is not set from command line or npm configuration gyp ERR! find Python Python is not set from environment variable PYTHON gyp ERR! find Python checking if "pytho.

zqq_2016的博客 2906

indows npm ERR! gyp ERR! find Python Python is not set from command line or npm configuration npm ER

gyp ERR!npm ERR!gyp ERR!npm ERR!gyp ERR!npm ERR!gyp ERR!npm ERR!npm ERR!gyp ERR!npm ERR!gyp ERR!npm ERR!gyp ERR!npm ERR!gyp ERR!npm ERR!gyp ERR!npm ERR!gyp ERR!

sdaujsj1的博客 1234

项目install的时候报错gyp ERR! find Python

项目install的时候报错gyp ERR! find Python

Anyuegogogo的博客 1万+

Python is not set from environment variable PYTHON

npm install Could not find any Python installation to use

zzh_Cochonbebe的博客 447

vue项目配置出错,项目重新安装依赖。

gyp ERR! find Python 安装fsevents依赖包报错 SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.3 (node_modules\fsevents): Error: Load config Error!

HDdgut的博客 2760

记一次npm安装依赖奇怪的gyp报python错误

记一次npm安装依赖奇怪的gyp报python错误@[TOC](记一次npm安装依赖奇怪的gyp报python错误错误一错误一解决错误二错误二解决 错误一 C:\Users\yuanz\Desktop\project\xxxxx\node_modules\fibers>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp

ifishbone的博客 2万+

npm install / yarn 执行的时候报错 gyp ERR! find Python 解决方案

gyp ERR! stack at exithandler (child_process.js:310:5) gyp ERR! stack at ChildProcess.errorhandler (child_process.js:322:5) gyp ERR! stack at ChildProcess.emit (events.js:315:20) gyp ERR! stack at Process.ChildProcess._handle.onexit (intern

wangtao88888888的博客 3万+

npm install 执行的时候报错 gyp ERR! find Python问题

npm install / yarn 执行的时候报错 gyp ERR! find Python 解决方案

remzhang的博客 5589

使用npm install报错npm ERR! gyp verb find Python Python is not set from command line or npm configuratio

使用npm install报了一大堆错误,一个搞后端的也要学会折腾前端啊。的纯 JavaScript 实现。是 C++ 版本,可以考虑使用。这个错误是由于在构建。

m0_53109028的博客 3187

解决npm install提示npm ERR! gyp ERR! stack Error: Could not find any Python installation to use

解决npm install提示npm ERR! gyp ERR! stack Error: Could not find any Python installation to use

空山新雨后,天气晚来秋 9847

npm报错处理

使用npm install报错: 开始以为是node-sass模块的问题,结果发现不是,查找发现是因为未找到python环境导致的,所以使用如下命令: npm config set python "C:\python\python.exe" 在重新: cnpm install 就好了

barry200890的专栏 972

gyp ERR! find Python 解决方案

node环境问题

qq_45031196的博客 3951

安装node-sass失败的解决方案

前言 今天安装node-sass安装失败包错误截取为: npm ERR! code 1 npm ERR! path D:\前端学习\网课\5阶段\code\11 工程化开发\webpack_base_use\node_modules\node-sass npm ERR! command failed npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node scripts/build.js libsass_ext= --lib...

helgeal的博客 4307
上一篇: 【日常笔记】Window10 系统 npm run dev 提示 ‘vue-cli-service‘ 不是内部或外部命令,也不是可运行的程序 或批处理文件
下一篇: 【Linux】Centos 7 安装 Jenkins
紧握手中沙
博客等级 码龄10年 11粉丝 76原创
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值