【问题标题】:angular pouchdb -ERROR Can't find Python executable "python", you can set the PYTHON env variableangular pouchdb -ERROR 找不到 Python 可执行文件“python”,您可以设置 PYTHON 环境变量
【发布时间】:2017-08-03 00:41:10
【问题描述】:

我正在尝试在 Angular 应用程序中安装 PouchDB。这在过去对我有用,但现在当我尝试创建一个新项目时,我得到了错误: " Can't find Python executable "python", you can set the PYTHON env variable "

我不确定为什么这是我遇到的错误,这与新的 Angular 有关系吗?或者可能是 PouchDB 6.3 版?任何帮助将不胜感激

【问题讨论】:

    标签: angular pouchdb


    【解决方案1】:

    我遇到了同样的问题,我通过使用较低的 node.js 版本解决了它:

    $ nvm list
    
      * 8.3.0 (Currently using 64-bit executable)
        7.4.0
        6.10.0
        4.4.7
        4.3.0
    
    $ nvm use 7.4.0
    $ npm i --save pouchdb
    ...
    $ nvm use 8.3.0
    

    原因是 pouchdb 使用的 leveldown 具有与您的操作系统和节点版本相对应的预打包二进制文件,因为它找不到我的,它试图构建它但出于某种原因(可能是 Windows 反斜杠问题)它不能。

    【讨论】:

    • 您的解决方案有效。现在我得到了错误:ERROR TypeError: __WEBPACK_IMPORTED_MODULE_2_pouchdb__ is not a constructor 我很确定这是我预先存在的代码所特有的东西
    • 太棒了!是的,很抱歉,但我不知道这个错误。
    • 是的,这很奇怪,错误指向我的代码 this.db = new PouchDB('users'); 中的这一行,它在我的构造函数中
    猜你喜欢
    • 2016-03-26
    • 1970-01-01
    • 2016-04-06
    • 1970-01-01
    • 1970-01-01
    • 2014-06-27
    • 1970-01-01
    • 2013-07-13
    • 2017-07-03
    相关资源
    最近更新 更多