当前位置: 首页 > 知识库问答 >
问题:

无法通过依赖于节点gyp的npm安装程序包

林夕
2023-03-14

这是我尝试安装包时得到的错误:

C:\WINDOWS\system32\node_modules\lame>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "C:\Program", you can set the PYTHON env variable.
gyp ERR! stack     at PythonFinder.failNoPython (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:483:19)
gyp ERR! stack     at PythonFinder.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:508:16)
gyp ERR! stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\polyfills.js:284:29
gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:158:21)
gyp ERR! System Windows_NT 10.0.17134
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:\WINDOWS\system32\node_modules\lame
gyp ERR! node -v v10.6.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! lame@1.2.4 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the lame@1.2.4 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\Home\AppData\Roaming\npm-cache\_logs\2018-07-08T23_48_21_208Z-debug.log

所有其他软件包,包括node-gypinstall-fine。我发现有一些人有类似的问题,但他们的解决方案都不起作用。根据这个答案的建议,我尝试了以下方法:

UPDATED 09/2016
If you're using Windows you can now install all node-gyp dependencies with single command (NOTE: Run As Admin in Windows PowerShell):

 $ npm install --global --production windows-build-tools
and then install the package

 $ npm install --global node-gyp
UPDATED 06/2018
https://github.com/nodejs/node-gyp/issues/809#issuecomment-155019383

Delete your $HOME/.node-gyp directory and try again.

See full documentation here: node-gyp

他们不得不采取行动。谢谢你抽出时间!

共有1个答案

水飞掣
2023-03-14

你安装了python吗?

这是你的错误:错误:找不到Python可执行文件"C:\Program",你可以设置PYTHON env变量.

你也可以把你的python放在一个没有空间的路径来解决你的问题,直到但是被修复

在github上查看此问题

 类似资料:
  • 问题内容: 我正在尝试使用安装模块。但是它总是会出错。这是错误: 我一直在搜索它,通常说它是关于。我的节点是v10.16.0。我还安装了Python 2.7。我的vs版本是2019。 确实,这仅与模块有关。如果是这样,是否还有其他解决方案可在Node.js中预览png等文件 编辑 我已卸载VS2019并安装了VS2017 Build Tools。但是仍然给出另一个错误: 问题答案: 我过去也遇到过

  • 我是新来的节点,有点超出我的深度。在Mac OS X和Centos 6上都遇到此错误。发生在我尝试过的所有npm install xxx命令中。任何关于如何避免这一错误的建议都将不胜感激。 类似于npm,安装时会出现节点gyp错误,但我的用户名中没有空格,这就解决了他的问题。

  • 我不断收到此错误消息: 可能未安装节点包。尝试使用“npm 安装”进行安装。找不到“@angular-devkit/build-angular:dev-server”构建器的节点包。 我做了以下事情来解决这个问题 堆栈溢出中的更多指令

  • 问题内容: 我正在尝试在Ubuntu PC上使用composer安装laravel安装程序,但是在安装过程中出现此错误。您的要求无法解决为一组可安装的软件包。 出现错误,然后我使用此注释: 问题答案: 它说它需要 zip扩展名 laravel / installer v1.4.0需要ext-zip ........ 安装与已安装的php版本相对应的版本:

  • 我们的构建管道是- 然而,这意味着我们的工件包含了所有的开发依赖。如果我们执行,我们将失去devDependence,但是将失败。 我们如何生成一个没有依赖性的测试工件?我们是否只需要相信,我们的应用程序在测试完devdependency后,会在没有devdependency的情况下运行? 额外问题:应如何适应此工作流?

  • 这些类型的问题一毛钱一打,我已经浏览了一个又一个资源,但似乎没有什么工作: https://github.com/nodejs/node-gyp/issues/629 NodeJS-使用NPM安装错误 http://blog.jimdhughes.com/2015/04/09/perils-with-node-gyp-and-windows-development/ 事情是这样的,我对NodeJS