Node JS抛出错误“找不到Python Executable”,即使可以从项目目录

时间:2018-03-23 22:48:31

标签: python node.js npm

****我正在开发一个Node.Js项目,该项目需要Python才能使应用程序正常运行。从我的Node Project目录运行命令“npm install”后,该项目抛出了一个错误,起初看起来很容易修复。 “无法找到Python可执行文件。”在以不同的方式设置Python环境路径3,并从我的项目路径成功访问我的python解释器后,它仍然抛出此错误。但我可以在命令行中输入“python”并拉出解释器。关于ELifecycle这个东西还有另外一个错误,即使在谷歌搜索和搜索StackOverflow后我也无能为力。这是我命令行的输出代码作为参考。此外,我已经编辑了不同的路径或类似的东西,只是因为我不喜欢向我的计算机广播世界。****

 C:\Users\<myPATH>\npm install
Cannot download "https://github.com/sass/node-sass/releases/download/v3.13.1/win32-x64-57_binding.node":

HTTP error 404 Not Found

Hint: If github.com is not accessible in your location
      try setting a proxy via HTTP_PROXY, e.g.

      export HTTP_PROXY=http://example.com:1234

or configure npm proxy via

      npm config set proxy http://example.com:8080
gyp info it worked if it ends with ok
gyp verb cli [ 'C:\\Program Files\\nodejs\\node.exe',
gyp verb cli   'C:\\Users\\<path>\\node-gyp.js',
gyp verb cli   'rebuild',
gyp verb cli   '--verbose',
gyp verb cli   '--libsass_ext=',
gyp verb cli   '--libsass_cflags=',
gyp verb cli   '--libsass_ldflags=',
gyp verb cli   '--libsass_library=' ]
gyp info using node-gyp@3.6.2
gyp info using node@8.9.4 | win32 | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "C:\Program Files\Python\Python36\;C:\Program Files\Python\Python36\python.exe;"C:\Program Files\Python\Python36\python.exe"" in the PATH
gyp verb `which` failed Error: not found: C:\Program Files\Python\Python36\;C:\Program Files\Python\Python36\python.exe;"C:\Program Files\Python\Python36\python.exe"
gyp verb `which` failed     at getNotFoundError C:\Users\<myUserName>\Desktop\Work\<Project>\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F C:\Users\<myUserName>\Desktop\Work\<Project>\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E C:\Users\<myUserName>\Desktop\Work\<Project>\node_modules\which\which.js:80:29)
gyp verb `which` failed     at C:\Users\<myUserName>\Desktop\Work\<Project>\node_modules\which\which.js:89:16
gyp verb `which` failed     at C:\Users\<myUserName>\Desktop\Work\<Project>\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at C:\Users\<myUserName>\Desktop\Work\<Project>\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:152:21)
gyp verb `which` failed  C:\Program Files\Python\Python36\;C:\Program Files\Python\Python36\python.exe;"C:\Program Files\Python\Python36\python.exe" { Error: not found: C:\Program Files\Python\Python36\;C:\Program Files\Python\Python36\python.exe;"C:\Program Files\Python\Python36\python.exe"
gyp verb `which` failed     at getNotFoundError C:\Users\<myUserName>\Desktop\Work\<Project>\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F C:\Users\<myUserName>\Desktop\Work\<Project>\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E C:\Users\<myUserName>\Desktop\Work\<Project>\node_modules\which\which.js:80:29)
gyp verb `which` failed     at C:\Users\<myUserName>\Desktop\Work\<Project>\node_modules\which\which.js:89:16
gyp verb `which` failed     at C:\Users\<myUserName>\Desktop\Work\<Project>\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at C:\Users\<myUserName>\Desktop\Work\<Project>\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:152:21)
gyp verb `which` failed   stack: 'Error: not found: C:\\Users\\<path>\\Programs\\Python\\Python36\\;C:\\Users\\<path>\\Programs\\Python\\Python36\\python.exe;"C:\\Users\\<path>\\Programs\\Python\\Python36\\python.exe"\n    at getNotFoundError (C:\\Users\\<project path>\\node_modules\\which\\which.js:13:12)\n    at F (C:\\Users\\<project path>\\node_modules\\which\\which.js:68:19)\n    at E (C:\\Users\\<project path>\\node_modules\\which\\which.js:80:29)\n    at C:\\Users\\<project path>\\node_modules\\which\\which.js:89:16\n    at C:\\Users\\<project path>\\node_modules\\isexe\\index.js:42:5\n    at C:\\Users\\<project path>\\node_modules\\isexe\\windows.js:36:5\n    at FSReqWrap.oncomplete (fs.js:152:21)',
gyp verb `which` failed   code: 'ENOENT' }
gyp verb could not find "C:\Program Files\Python\Python36\;C:\Program Files\Python\Python36\python.exe;"C:\Program Files\Python\Python36\python.exe"". checking python launcher
gyp verb could not find "C:\Program Files\Python\Python36\;C:\Program Files\Python\Python36\python.exe;"C:\Program Files\Python\Python36\python.exe"". guessing location
gyp verb ensuring that file exists: C:\Python27\python.exe
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "C:\Program Files\Python\Python36\;C:\Program Files\Python\Python36\python.exe;"C:\Program Files\Python\Python36\python.exe"", you can set the PYTHON env variable.
gyp ERR! stack     at PythonFinder.failNoPython (C:\Users\<project path>\node_modules\node-gyp\lib\configure.js:483:19)
gyp ERR! stack     at PythonFinder.<anonymous> (C:\Users\<project path>\node_modules\node-gyp\lib\configure.js:508:16)
gyp ERR! stack     at C:\Users\<project path>\node_modules\graceful-fs\polyfills.js:284:29
gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:152:21)
gyp ERR! System Windows_NT 10.0.16299
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\<project Path>\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd C:\Users\<project path>\node_modules\node-sass
gyp ERR! node -v v8.9.4
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
Build failed with error code: 1
npm WARN redux-form@6.8.0 requires a peer of react@^15.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN upstar_music@1.0.0 No description
npm WARN upstar_music@1.0.0 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@3.13.1 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@3.13.1 postinstall 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\<myUSERName>\AppData\Roaming\npm-cache\_logs\2018-03-23T22_07_09_160Z-debug.log

我正在安装许多不同的节点包,以便运行来自我的编码指导员的预先创建的程序。有两个特定的输出部分,我不明白如何解决。第一个是关于“设置PYTHON env变量”,第二个是关于我从未听说过的“ELIFECYCLE”。以下是我在尝试解决这两个问题时所做的工作:

1)我已经安装了Python,Python版本是Python 3.6.4,日期为“2017年12月19日”。从我的节点项目的位置,我已经可以在命令行中输入“python”,并在Python32上出现Python解释器:'Python 3.6.4(v3.6.4 .......等)。输入“帮助”,“版权”或“许可证”以获取更多信息“'。     - 现在这是第一个错误对我没有意义的地方。当我可以清楚地输入Python并启动解释器时,怎么能找不到Python可执行文件?我不明白的是什么?显然我有些不对劲,但我不知道是什么。

2)我尝试了多种不同的方法来安装python并设置路径,实际上是3。第一个,在CMD窗口中使用“set”命令(这不能按照我想要的方式工作,因为每次打开CMD线都要设置该参数。其次,我使用控制面板设置它,我也可以在完成之后拔出PYthon解释器。第三,我卸载了Python,当我进行干净安装时,我选中了“将python添加到系统变量”框。从那以后我运行我的python解释器没有问题CMD线。

3)我已经通过Stack Overflow搜索了关于这个特殊错误的许多不同问题,其中出现了很多,但是使用我已经完成的3种方法中的任何一种方式进行投票的解决方案都没有工作为了我。并且,似乎已经解决的其他问题仅仅是因为他们无法将python解释器从他们的项目路径(我可以做)中解决。所以,我只是不确定命令行是否正确识别错误。 (我不知道,对于这些事情,我是一个完整的菜鸟。)

4)我在互联网上搜索了“ElifeCycle是什么”......但是我无法弄清楚该错误究竟是指什么。

所以我希望你们能帮助我解决有关Python错误和上面命令行输出中列出的“ELIFECYCLE”错误的两个问题。

非常感谢您花时间阅读本文。我知道这可能只是简单的事情。但我在这里结束了。我花了5个多小时试图解决这个问题,但没有任何工作。谢谢!

0 个答案:

没有答案