在“npm jsbin”安装过程中找不到Python作为依赖项。(Python not found as dependency during ' npm jsbin' instal

编程入门 行业动态 更新时间:2024-10-26 09:34:50
在“npm jsbin”安装过程中找不到Python作为依赖项。(Python not found as dependency during ' npm jsbin' installation. What is missing?)

这个问题是我在尝试在本地安装jsbin时遇到的问题创建的。 JGallardo要求我提出一个问题,因为我最初在原始问答中发表了评论(请点击链接查看它的内容)。

更新:由于审阅者已删除Windows标记,请注意我在Windows 7计算机上遇到问题。

命令npm install jsbin对我不起作用 - 它抛出一个我不明白的错误: "npm ERR! Error: getaddrinfo EAGAIN npm ERR! at errnoException (dns.js:37:11) npm ERR! at Object.onanswer [as oncomplete] (dns.js:124:16)"

我已经设置了一个代理服务器,我发现这是必需的: npm config set proxy=http://servername:port 。 现在它正在获取文件,当我将npm install jsbin调用到"c:\users\myuser\AppData\Roaming\npm-cache"目录时 - 但它运行的时间很长。 现在它说"can't find python executable" - 你知道这是哪个依赖吗? 如果需要,我该如何安装python包?

得到上面的错误后,我还尝试在运行npn install jsbin之前安装npn install python 。 它也没有用,我仍然得到错误"Error: Can't find Python executable "python", you can set the PYTHON env variable."

你能帮忙在本地安装jsbin吗? 为什么npm找不到python包,虽然它似乎已经安装好了?

NB我现在还从官方来源安装了官方Python解释器,并验证它是通过path环境变量提供的:

Your environment has been set up for using Node.js 0.10.12 (x64) and npm. C:\>python Python 3.3.2 (v3.3.2:d047928ae3f6, May 16 2013, 00:06:53) [MSC v.1600 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>>

此外,我已将PYTHON环境变量设置为安装python系统的路径C:\Python33 。

我得到的错误是:

gyp ERR! configure error gyp ERR! stack Error: spawn ENOENT gyp ERR! stack at errnoException (child_process.js:980:11) gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:771:34) gyp ERR! System Windows_NT 6.1.7601 gyp ERR! command "node" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" gyp ERR! cwd C:\Python33\node_modules\jsbin\node_modules\bcrypt gyp ERR! node -v v0.10.12 gyp ERR! node-gyp -v v0.10.0 gyp ERR! not ok

This question was created from issues I've encountered while trying to install jsbin locally. JGallardo has asked me to create a question from it, because originally I've posted comments in the original Q&A (please follow the link to see what it was about).

Update: Since the Windows tag has been removed by reviewers, let me note that I am having the issues on a Windows 7 machine.

The command npm install jsbin don't work for me - it throws an error I don't understand: "npm ERR! Error: getaddrinfo EAGAIN npm ERR! at errnoException (dns.js:37:11) npm ERR! at Object.onanswer [as oncomplete] (dns.js:124:16)"

I've set up a proxy server, which is required in my case as I found: npm config set proxy=http://servername:port. Now it is fetching files, when I call npm install jsbin into the "c:\users\myuser\AppData\Roaming\npm-cache" directory - but it is running very long. Now it is saying "can't find python executable" - do you know which dependency this is? How can I install the python package if that is required?

After getting the error above, I have also tried to install npn install python before running npn install jsbin. It also did not work, I am still getting the error "Error: Can't find Python executable "python", you can set the PYTHON env variable."

Can you help to get jsbin installed locally? Why can't npm find the python package although it seems to be installed?

N.B. I now have also installed the official Python interpreter from the official source and verified that it is available through the pathenvironment variable:

Your environment has been set up for using Node.js 0.10.12 (x64) and npm. C:\>python Python 3.3.2 (v3.3.2:d047928ae3f6, May 16 2013, 00:06:53) [MSC v.1600 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>>

Also, I've set up the PYTHONenvironment variable to the path C:\Python33 where the python system was installed to.

The error I am getting is:

gyp ERR! configure error gyp ERR! stack Error: spawn ENOENT gyp ERR! stack at errnoException (child_process.js:980:11) gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:771:34) gyp ERR! System Windows_NT 6.1.7601 gyp ERR! command "node" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" gyp ERR! cwd C:\Python33\node_modules\jsbin\node_modules\bcrypt gyp ERR! node -v v0.10.12 gyp ERR! node-gyp -v v0.10.0 gyp ERR! not ok

最满意答案

我无法找出为什么NPN没有安装python,但后来我尝试使用不同的安装程序, choco(或Chocolatey) ,它成功了。

步骤是:

安装Chocolatey。 有关说明,请参阅Chocolatey网站 打开管理员控制台,然后执行以下操作:

C:\WINDOWS\system32> choco install python

!!ATTENTION!!
The next version of Chocolatey (v0.9.9) will require -y to perform
  behaviors that change state without prompting for confirmation. Start
  using it now in your automated scripts.

  For details on the all new Chocolatey, visit http://bit.ly/new_choco
Chocolatey (v0.9.8.33) is installing 'python' and dependencies. 
By installing you accept the license for 'python' and each dependency you are installing.

python v3.4.3
Using this proxyserver: defrceprx02.ey.net:8443
Downloading python 64 bit
  from 'https://www.python.org/ftp/python/3.4.3/python-3.4.3.amd64.msi'
Using this proxyserver: defrceprx02.ey.net:8443
Installing python...
python has been installed.
python has finished successfully! The chocolatey gods have answered your request!
PATH environment variable does not have C:\tools\python in it. Adding...
Finished installing 'python' and dependencies - if errors not shown in console, none detected. 
Check log for errors if unsure.
 

C:\WINDOWS\system32>

I could not find out why NPN wasn't installing python, but then I tried it with a different installer, choco (or Chocolatey), which succeeded.

Steps are:

Install Chocolatey. See Chocolatey website for instructions Open administrator console, then do the following:

C:\WINDOWS\system32>choco install python

!!ATTENTION!!
The next version of Chocolatey (v0.9.9) will require -y to perform
  behaviors that change state without prompting for confirmation. Start
  using it now in your automated scripts.

  For details on the all new Chocolatey, visit http://bit.ly/new_choco
Chocolatey (v0.9.8.33) is installing 'python' and dependencies. 
By installing you accept the license for 'python' and each dependency you are installing.

python v3.4.3
Using this proxyserver: defrceprx02.ey.net:8443
Downloading python 64 bit
  from 'https://www.python.org/ftp/python/3.4.3/python-3.4.3.amd64.msi'
Using this proxyserver: defrceprx02.ey.net:8443
Installing python...
python has been installed.
python has finished successfully! The chocolatey gods have answered your request!
PATH environment variable does not have C:\tools\python in it. Adding...
Finished installing 'python' and dependencies - if errors not shown in console, none detected. 
Check log for errors if unsure.
 

C:\WINDOWS\system32>

更多推荐

本文发布于:2023-04-27 12:57:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1327126.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:找不到   过程中   jsbin   npm   missing

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!