在OSX上安装Ionic 2

时间:2016-12-07 09:50:09

标签: macos ionic2

我正在使用Ionic 2.0.0-beta.20npm 3.10.8node 6.9.2 LTS。我之所以要使用这个版本,是因为我在Windows上有一个现有的Ionic版本。

我的问题如下。我在OSX上安装了Ionic 2.0.0-beta.20,但是当我尝试创建一个新应用并serve该应用时,我会收到以下错误。

  

Couldn't find ionic.json file. Are you in an Ionic project?

但是有一个ionic.config.json文件。

enter image description here

如果有人可以请给我一些建议如何在OSX上运行Ionic我会很感激。当我在Windows上做同样的事情时,我似乎没有任何问题。

由于

更新

我降级为node 6.2.2,但正如您所见,我仍然会遇到同样的错误。

enter image description here

更新

正如您所看到的,有一个ionic.config.json文件。我应该将其重命名为ionic.json吗?

enter image description here

更新

的package.json

{
  "name": "ionic-app-base",
  "author": "Ionic Framework",
  "homepage": "http://ionicframework.com/",
  "private": true,
  "scripts": {
    "ionic:build": "ionic-app-scripts build",
    "ionic:serve": "ionic-app-scripts serve"
  },
  "dependencies": {
    "@angular/common": "2.1.1",
    "@angular/compiler": "2.1.1",
    "@angular/compiler-cli": "2.1.1",
    "@angular/core": "2.1.1",
    "@angular/forms": "2.1.1",
    "@angular/http": "2.1.1",
    "@angular/platform-browser": "2.1.1",
    "@angular/platform-browser-dynamic": "2.1.1",
    "@angular/platform-server": "2.1.1",
    "@ionic/storage": "1.1.6",
    "ionic-angular": "2.0.0-rc.3",
    "ionic-native": "2.2.3",
    "ionicons": "3.0.0",
    "rxjs": "5.0.0-beta.12",
    "zone.js": "0.6.26"
  },
  "devDependencies": {
    "@ionic/app-scripts": "0.0.45",
    "typescript": "2.0.6"
  },
  "cordovaPlugins": [
    "cordova-plugin-whitelist",
    "cordova-plugin-console",
    "cordova-plugin-statusbar",
    "cordova-plugin-device",
    "cordova-plugin-splashscreen",
    "ionic-plugin-keyboard"
  ],
  "cordovaPlatforms": []
}

更新

如果我将ionic.config.json文件重命名为ionic.jsonionic serve会启动并尝试在浏览器中打开该应用,但会收到以下错误:

 Error: ENOENT: no such file or directory, open
 '/Users/richardmarais/ionic-apps/theWhoZoo/www/index.html'

1 个答案:

答案 0 :(得分:0)

Known Issue in beta

您可能必须降级节点版本。也许(6.2)

更新:

    "ionic-angular": "2.0.0-rc.3",

您的项目在RC 3中未在Beta中 您可以安装最新的离子cli

npm install -g ionic@latest

并恢复到最新的npm