Cordova installation error: path issue (?) - error code ENOENT

前端 未结 5 1353
轻奢々
轻奢々 2021-02-20 05:00

After installing Xcode & NodeJS I am now trying to install Cordova but I am getting the following error regarding a missing file (wrong path?).

Luciens-MacBo         


        
相关标签:
5条回答
  • 2021-02-20 05:32

    Uninstalling cordova and then installing it worked for me.

    cd /usr/local/lib/node_modules/
    sudo npm uninstall -g cordova
    sudo npm install -g cordova
    
    0 讨论(0)
  • 2021-02-20 05:32

    Solve it using YARN

    sudo npm install -g yarn
    yarn install -g cordova
    
    0 讨论(0)
  • 2021-02-20 05:40

    I had the same issue once with other packages. I had to reinstall node from here https://nodejs.org/en/download/. For me it happened when I tried to install packages globally without sudo, or when I was cancelling some installation package installation process with ctrc+c. After that there was no way to fix it but to reinstall node. I am also on a mac and now really carefull about letting npm do its job...

    0 讨论(0)
  • 2021-02-20 05:43

    I found this problem on Fedora Core 22 too when install latest Apache Cordova ( version 6.0.0 ) the problem may npm miss something about permission check when install with sudo npm install -g cordova.

    npm ERR! enoent ENOENT, rename '/lib/node_modules/.staging/abbrev-cxxxxxx'
    

    npm ERR! enoent ENOENT, rename '/lib/node_modules/.staging/abbrev-xxxxxxx'

    So solve this problem with run as root ( sudo -s ) and run npm install -g cordova again the problem will solve. ( In my environment ).

    For my environment ( Fedora core 22 ) it does not need to reinstall node from nodejs.org

    0 讨论(0)
  • 2021-02-20 05:55

    First uninstall cordova : npm uninstall -g cordova The re-install cordova npm install -g cordova

    0 讨论(0)
提交回复
热议问题