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

错误异常

 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就不会报错了测试

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
### 回答1: "nmp: command not found"错误通常是由于用户输入了错误的命令或者未正确安装Node.js导致的。应该是输入错误了,想要运行NPM命令,但是却输入成了"NMP"。这是因为在命令行中,所有的命令都是区分大小写的,正确的是"NPM"而不是"NMP"。 另一种可能是Node.js未正确地安装或配置。在安装Node.js时,默认情况下会同时安装NPM。虽然您在命令行中输入"npm -v"可以显示版本号,但是如果命令行不能找到"npm"命令,那可能是缺少环境路径变量或者安装过程中发生了错误。 要解决这个问题,您可以尝试以下几个方法: 1. 确保您正确输入"NPM"而不是"NMP",检查拼写错误。 2. 重新安装Node.js。首先卸载当前的Node.js版本,然后重新下载并安装最新版本的Node.js。确保在安装过程中选择了安装NPM。 3. 检查您的系统环境变量。在Windows系统中,您可以找到系统属性 -> 高级系统设置 -> 环境变量。在"系统变量"部分,确保"Path"变量包含了Node.js安装目录和NPM的安装目录。 4. 如果您使用的是*nix系统(如Linux或Mac),尝试使用包管理工具(如apt-get或yum)重新安装Node.js。 5. 如果您的问题仍然未解决,可以尝试搜索和参考Node.js和NPM的相关文档,或者在相关的技术论坛上寻求帮助。 希望以上方法能够帮助您解决"NMP: command not found"错误并正常运行NPM命令。 ### 回答2: 当出现 "nmp: command not found" 错误时,这可能意味着您没有正确安装Node.js或者Node Package Manager(NPM)。NPM是Node.js的包管理器,用于安装和管理Node.js模块。 要解决此问题,您可以按照以下步骤进行操作: 1. 首先,确保您已经正确地安装了Node.js。您可以在终端中运行 "node -v" 命令来检查Node.js的版本。如果没有任何输出或者提示 "command not found",说明您没有安装Node.js或者它的安装路径没有添加到系统的 PATH 环境变量中。您需要重新安装Node.js并确保将其路径添加到 PATH 环境变量中。 2. 如果您确认已经安装了Node.js,请检查NPM是否正确安装。您可以在终端中运行 "npm -v" 命令来检查NPM的版本。如果输出显示版本号,则意味着NPM已经正确安装。如果无法找到命令或提示 "command not found",可能是由于NPM没有正确安装或在系统的 PATH 环境变量中没有被包含。您可以尝试重新安装NPM并确保将其路径添加到 PATH 环境变量中。 如果您已经安装了Node.js和NPM,并且使用 "npm -v" 命令可显示版本号,但仍然出现 "nmp: command not found" 的错误,请检查您是否输入了错误的命令,即输入的命令是 "nmp" 而不是 "npm"。请注意,正确的命令是 "npm"。 如果您仍然遇到问题,请仔细检查您的安装过程,确保按照官方文档或指南进行安装。您还可以尝试在社区或开发者论坛中寻求帮助,以便得到更具体的解决方案。 ### 回答3: nmp: command not found 错误表示系统中没有安装名为nmp的命令。这通常是由于拼写错误或者在系统中未正确安装npm导致的。 npm是一个非常受欢迎的Node.js软件包管理器,它允许您在项目中安装和管理依赖包。而nmp是错误拼写。 如果您已经正确地安装了npm,那么可以通过输入npm -v来检查npm的版本号。这个命令会告诉您所安装的npm的版本,这说明npm已成功安装在您的系统中。 要解决“nmp: command not found”错误,您可以尝试以下几步骤: 1. 确保正确拼写npm命令:请检查是否将npm命令正确输入为“npm”,而不是“nmp”。 2. 检查npm是否正确安装:请确认您的系统中已经正确安装了npm。您可以在终端中输入“npm -v”来检查npm的版本。如果返回版本号,则说明npm已成功安装。如果没有返回版本号,则需要重新安装npm。 3. 检查npm的安装路径:如果您已经正确安装了npm,但仍然遇到问题,可能是由于系统没有正确设置npm的可执行路径所致。您可以尝试手动设置npm的路径,或者尝试在终端中使用绝对路径来执行npm命令。 如果您仍然无法解决问题,建议查阅npm的官方文档或者在相关的技术社区中寻求帮助。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值