科尔多瓦有SyntaxError:无效的正则表达式

时间:2019-02-06 19:39:31

标签: node.js cordova npm

我使用以下方法安装了cordova:

  

npm安装cordova -g

运行以下命令时出现错误:

  

cordova -v

? May Cordova anonymously report usage statistics to improve the tool over time? (Y/n) Invalid regular expression: /.{1,0}/: numbers out of order in {} quantifier
n? May Cordova anonymously report usage statistics to improve the tool over time? (Y/n) n

readline.js:1021
            throw err;
            ^

SyntaxError: Invalid regular expression: /.{1,0}/: numbers out of order in {} quantifier
    at new RegExp (<anonymous>)
    at breakLines (/usr/local/lib/node_modules/cordova/node_modules/insight/node_modules/inquirer/lib/utils/screen-manager.js:108:15)
    at module.exports.ScreenManager.render (/usr/local/lib/node_modules/cordova/node_modules/insight/node_modules/inquirer/lib/utils/screen-manager.js:55:22)
    at Prompt.render (/usr/local/lib/node_modules/cordova/node_modules/insight/node_modules/inquirer/lib/prompts/confirm.js:85:15)
    at Prompt.onKeypress (/usr/local/lib/node_modules/cordova/node_modules/insight/node_modules/inquirer/lib/prompts/confirm.js:109:10)
    at AnonymousObserver.Rx.AnonymousObserver.AnonymousObserver.next (/usr/local/lib/node_modules/cordova/node_modules/insight/node_modules/rx-lite/rx.lite.js:1535:12)
    at AnonymousObserver.Rx.internals.AbstractObserver.AbstractObserver.onNext (/usr/local/lib/node_modules/cordova/node_modules/insight/node_modules/rx-lite/rx.lite.js:1469:31)
    at AnonymousObserver.tryCatcher (/usr/local/lib/node_modules/cordova/node_modules/insight/node_modules/rx-lite/rx.lite.js:63:31)
    at AutoDetachObserverPrototype.next (/usr/local/lib/node_modules/cordova/node_modules/insight/node_modules/rx-lite/rx.lite.js:5782:51)
    at AutoDetachObserver.Rx.internals.AbstractObserver.AbstractObserver.onNext (/usr/local/lib/node_modules/cordova/node_modules/insight/node_modules/rx-lite/rx.lite.js:1469:31)

我该如何解决?

  

cat / etc / os-release

NAME="Ubuntu"
VERSION="18.04.1 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.1 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic
  

节点-v

v8.10.0

  

npm -v

3.5.2

0 个答案:

没有答案