node.js - 无法使用 npm 安装播放器模块

标签 node.js

我正在尝试安装以下 Node 模块:

https://www.npmjs.com/package/player

尝试使用命令安装它

npm install player

我得到以下错误输出墙:

C:\Users\AbfalterJakob\MEGA\Projekte\PinkstarTVBots>npm install player

> <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="bfd3ded2daff8e918d918c" rel="noreferrer noopener nofollow">[email protected]</a> install C:\Users\AbfalterJakob\MEGA\Projekte\PinkstarTVBots\node_modules\lame
> node-gyp rebuild


C:\Users\AbfalterJakob\MEGA\Projekte\PinkstarTVBots\node_modules\lame>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node  rebuild )
gyp ERR! configure error
gyp ERR! stack Error: Python executable "python" is v3.4.4, which is not supported by gyp.
gyp ERR! stack You can pass the --python switch to point to Python >= v2.5.0 & < 3.0.0.
gyp ERR! stack     at failPythonVersion (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:121:14)
gyp ERR! stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:110:9
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:204:7)
gyp ERR! stack     at emitTwo (events.js:100:13)
gyp ERR! stack     at ChildProcess.emit (events.js:185:7)
gyp ERR! stack     at maybeClose (internal/child_process.js:821:16)
gyp ERR! stack     at Socket.<anonymous> (internal/child_process.js:319:11)
gyp ERR! stack     at emitOne (events.js:90:13)
gyp ERR! stack     at Socket.emit (events.js:182:7)
gyp ERR! stack     at Pipe._onclose (net.js:469:12)
gyp ERR! System Windows_NT 10.0.10586
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\AbfalterJakob\MEGA\Projekte\PinkstarTVBots\node_modules\lame
gyp ERR! node -v v5.5.0
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
npm WARN install:<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="640805090124554a564a57" rel="noreferrer noopener nofollow">[email protected]</a> <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="94f8f5f9f1d4a5baa6baa7" rel="noreferrer noopener nofollow">[email protected]</a> install: `node-gyp rebuild`
npm WARN install:<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="375b565a52770619051904" rel="noreferrer noopener nofollow">[email protected]</a> Exit status 1

> <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="8bf8fbeeeae0eef9cbbba5b9a5bd" rel="noreferrer noopener nofollow">[email protected]</a> install C:\Users\AbfalterJakob\MEGA\Projekte\PinkstarTVBots\node_modules\speaker
> node-gyp rebuild


C:\Users\AbfalterJakob\MEGA\Projekte\PinkstarTVBots\node_modules\speaker>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node  rebuild )
gyp ERR! configure error
gyp ERR! stack Error: Python executable "python" is v3.4.4, which is not supported by gyp.
gyp ERR! stack You can pass the --python switch to point to Python >= v2.5.0 & < 3.0.0.
gyp ERR! stack     at failPythonVersion (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:121:14)
gyp ERR! stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:110:9
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:204:7)
gyp ERR! stack     at emitTwo (events.js:100:13)
gyp ERR! stack     at ChildProcess.emit (events.js:185:7)
gyp ERR! stack     at maybeClose (internal/child_process.js:821:16)
gyp ERR! stack     at Socket.<anonymous> (internal/child_process.js:319:11)
gyp ERR! stack     at emitOne (events.js:90:13)
gyp ERR! stack     at Socket.emit (events.js:182:7)
gyp ERR! stack     at Pipe._onclose (net.js:469:12)
gyp ERR! System Windows_NT 10.0.10586
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\AbfalterJakob\MEGA\Projekte\PinkstarTVBots\node_modules\speaker
gyp ERR! node -v v5.5.0
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
npm WARN install:<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="d2a1a2b7b3b9b7a092e2fce0fce4" rel="noreferrer noopener nofollow">[email protected]</a> <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="3b484b5e5a505e497b0b1509150d" rel="noreferrer noopener nofollow">[email protected]</a> install: `node-gyp rebuild`
npm WARN install:<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="35464550545e504775051b071b03" rel="noreferrer noopener nofollow">[email protected]</a> Exit status 1

> <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="f19384979794838485989db1c0dfc3dfc0" rel="noreferrer noopener nofollow">[email protected]</a> install C:\Users\AbfalterJakob\MEGA\Projekte\PinkstarTVBots\node_modules\ws\node_modules\bufferutil
> node-gyp rebuild


C:\Users\AbfalterJakob\MEGA\Projekte\PinkstarTVBots\node_modules\ws\node_modules\bufferutil>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node  rebuild )
gyp ERR! configure error
gyp ERR! stack Error: Python executable "python" is v3.4.4, which is not supported by gyp.
gyp ERR! stack You can pass the --python switch to point to Python >= v2.5.0 & < 3.0.0.
gyp ERR! stack     at failPythonVersion (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:121:14)
gyp ERR! stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:110:9
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:204:7)
gyp ERR! stack     at emitTwo (events.js:100:13)
gyp ERR! stack     at ChildProcess.emit (events.js:185:7)
gyp ERR! stack     at maybeClose (internal/child_process.js:821:16)
gyp ERR! stack     at Socket.<anonymous> (internal/child_process.js:319:11)
gyp ERR! stack     at emitOne (events.js:90:13)
gyp ERR! stack     at Socket.emit (events.js:182:7)
gyp ERR! stack     at Pipe._onclose (net.js:469:12)
gyp ERR! System Windows_NT 10.0.10586
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\AbfalterJakob\MEGA\Projekte\PinkstarTVBots\node_modules\ws\node_modules\bufferutil
gyp ERR! node -v v5.5.0
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
npm WARN install:<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="2b495e4d4d4e595e5f42476b1a0519051a" rel="noreferrer noopener nofollow">[email protected]</a> <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="c1a3b4a7a7a4b3b4b5a8ad81f0eff3eff0" rel="noreferrer noopener nofollow">[email protected]</a> install: `node-gyp rebuild`
npm WARN install:<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="c2a0b7a4a4a7b0b7b6abae82f3ecf0ecf3" rel="noreferrer noopener nofollow">[email protected]</a> Exit status 1

> <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="14616072392c396275787d7075607154253a263a25" rel="noreferrer noopener nofollow">[email protected]</a> install C:\Users\AbfalterJakob\MEGA\Projekte\PinkstarTVBots\node_modules\ws\node_modules\utf-8-validate
> node-gyp rebuild


C:\Users\AbfalterJakob\MEGA\Projekte\PinkstarTVBots\node_modules\ws\node_modules\utf-8-validate>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node  rebuild )
gyp ERR! configure error
gyp ERR! stack Error: Python executable "python" is v3.4.4, which is not supported by gyp.
gyp ERR! stack You can pass the --python switch to point to Python >= v2.5.0 & < 3.0.0.
gyp ERR! stack     at failPythonVersion (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:121:14)
gyp ERR! stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:110:9
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:204:7)
gyp ERR! stack     at emitTwo (events.js:100:13)
gyp ERR! stack     at ChildProcess.emit (events.js:185:7)
gyp ERR! stack     at maybeClose (internal/child_process.js:821:16)
gyp ERR! stack     at Socket.<anonymous> (internal/child_process.js:319:11)
gyp ERR! stack     at emitOne (events.js:90:13)
gyp ERR! stack     at Socket.emit (events.js:182:7)
gyp ERR! stack     at Pipe._onclose (net.js:469:12)
gyp ERR! System Windows_NT 10.0.10586
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\AbfalterJakob\MEGA\Projekte\PinkstarTVBots\node_modules\ws\node_modules\utf-8-validate
gyp ERR! node -v v5.5.0
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
npm WARN install:<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="433637256e7b6e35222f2a2722372603726d716d72" rel="noreferrer noopener nofollow">[email protected]</a> <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="f5808193d8cdd88394999c91948190b5c4dbc7dbc4" rel="noreferrer noopener nofollow">[email protected]</a> install: `node-gyp rebuild`
npm WARN install:<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="b6c3c2d09b8e9bc0d7dadfd2d7c2d3f68798849887" rel="noreferrer noopener nofollow">[email protected]</a> Exit status 1
C:\Users\AbfalterJakob\MEGA\Projekte\PinkstarTVBots
└── (empty)

npm WARN ENOENT ENOENT: no such file or directory, open 'C:\Users\AbfalterJakob\MEGA\Projekte\PinkstarTVBots\package.json'
npm WARN ENOENT ENOENT: no such file or directory, open 'C:\Users\AbfalterJakob\MEGA\Projekte\PinkstarTVBots\node_modules\utf-8-validate\package.json'
npm WARN ENOENT ENOENT: no such file or directory, open 'C:\Users\AbfalterJakob\MEGA\Projekte\PinkstarTVBots\node_modules\bufferutil\package.json'
npm WARN EPACKAGEJSON PinkstarTVBots No description
npm WARN EPACKAGEJSON PinkstarTVBots No repository field.
npm WARN EPACKAGEJSON PinkstarTVBots No README data
npm WARN EPACKAGEJSON PinkstarTVBots No license field.
npm ERR! code 1

C:\Users\AbfalterJakob\MEGA\Projekte\PinkstarTVBots>

我无法从这个错误中找出导致问题的原因。我已经尝试安装node-gyp,它有效,但没有改变任何东西。

最佳答案

您的系统中使用/安装的版本似乎不受支持。

gyp ERR! stack Error: Python executable "python" is v3.4.4, which is not supported by gyp.
gyp ERR! stack You can pass the --python switch to point to Python >= v2.5.0 & < 3.0.0.

尝试安装低于 3.0.0 且高于 2.5.0 的 Python 版本。应该可以解决问题。

node-gyp 的 GitHub 页面中他们推荐Python v2.7

关于node.js - 无法使用 npm 安装播放器模块,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35253828/

相关文章:

node.js - 从消息中获取图像 URL

node.js - Angular/TypeScript 编译的初学者问题

node.js - 当存在index.d.ts时,TypeScript不会导入index.js

Node.js:如何从模块中获取需要函数的文件名?

node.js - NodeJS 加载网站并在渲染之前从页面中删除元素

mongodb - 使用 Mongoose、Express、NodeJS 更新模型

javascript - 导出对象与函数 NodeJs

javascript - nodeJS exec 不适用于 "cd "shell cmd

javascript - 序列化 Javascript 代码

node.js - 如何在 Docker 版本上缓存 node_modules?