当前位置: 动力学知识库 > 问答 > 编程问答 >

osx - PhoneGap Mac CLI local install failed because of Node version

问题描述:

So I want to debug my Phonegap webapp locally in Xcode.

I follow the step here and here, and launch in MAC CLI

$ sudo npm install -g phonegap

BUT install failed and CLI result get lots of errors with the first one is :

engine [email protected]: wanted: {"node":">=0.10.0"} (current: {"node":"v0.8.8","npm":"1.1.59"})

I understand my node version is too old : 0.8.8

node --version


I try to update but I am stuck with those 2 methods here and both in errors for me :

BREW

Tried Homebrew but did not work :

$ brew upgrade node

Error: node-0.8.8 already installed

NPM

As I found here

Upgrading Node.js to latest version

How to update node.js, npm and all other dependencies?

$ sudo npm install -g n

$ sudo n stable

sudo: n: command not found

网友答案:

In fact my bash_profile was missing the path to the n module as I found here:
cannot install npm? problems generating application

Edit your ~/.bash_profile. Add this export somewhere.

export PATH=/usr/local/bin:$PATH:/usr/local/share/npm/bin
网友答案:

I had the same issue and fixed it by upgrading node with brew, I just run

brew install --upgrade node
分享给朋友:
您可能感兴趣的文章:
随机阅读: