2016-11-18 35 views
-1

我用命令創建一個應用程序Ionic2:爲什麼WWW文件夾爲空的應用程序創建使用Ionic2

離子開始拉胡爾--v2

是 CD拉胡爾
離子後服務

但顯示我錯誤的瀏覽器: 錯誤:ENOENT:沒有這樣的文件或目錄,打開'/usr/local/n/versions/node/7.0.0/rahul/www/index.html'

然後我檢查了WW w文件夾,我發現除了一個名爲.gitkeep的文件外沒有任何東西。

NPM -v = 3.10.8
節點-v = V7.0.0
科爾多瓦-v = 6.4.0
離子-v = 2.1.0-beta.3

的package.json :

{ 
    "name": "ionic-hello-world", 
    "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" 
    }, 
    "description": "jain: An Ionic project", 
    "cordovaPlugins": [ 
    "cordova-plugin-device", 
    "cordova-plugin-console", 
    "cordova-plugin-whitelist", 
    "cordova-plugin-splashscreen", 
    "cordova-plugin-statusbar", 
    "ionic-plugin-keyboard" 
    ], 
    "cordovaPlatforms": [] 
} 
+0

嘗試更新您的離子Cli,然後創建一個新的 –

+0

此問題已發佈http://stackoverflow.com/questions/40669878/error-enoent-no-such-file-or-directory-open-in -ionic2 –

+0

npm -v = 3.10.8,node -v = v7.0.0,cordova -v = 6.4.0,ionic -v = 2.1.0-beta.3 – Rahul

回答

0

出事了與我的Ionic2安裝。

這裏是安裝ionic2的步驟,如果您已經安裝離子。 更新節點 更新NPM

然後最重要的是更新的離子和科爾多瓦同時這樣的:由一個我安裝的離子和科爾多瓦之一: NPM安裝-g離子科爾多瓦

我做了錯誤的。

1

更新您的package.json下面你這麼離子服務將工作 這裏script對象被改變,那麼一切都按預期。 但我仍在研究它爲什麼不自動更新。

看看這個鏈接http://blog.ionic.io/improvements-to-ionic-build-process/

{ 
    "name": "ionic-hello-world", 
    "author": "Ionic Framework", 
    "homepage": "http://ionicframework.com/", 
    "private": true, 
    "scripts": { 
    "build": "ionic-app-scripts build", 
    "watch": "ionic-app-scripts watch", 
    "serve:before": "watch", 
    "emulate:before": "build", 
    "deploy:before": "build", 
    "build:before": "build", 
    "run:before": "build" 
    }, 
    "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" 
    }, 
    "description": "ionic1: An Ionic project", 
    "cordovaPlugins": [ 
    "cordova-plugin-device", 
    "cordova-plugin-console", 
    "cordova-plugin-whitelist", 
    "cordova-plugin-splashscreen", 
    "cordova-plugin-statusbar", 
    "ionic-plugin-keyboard" 
    ], 
    "cordovaPlatforms": [] 
} 
相關問題