2017-04-27 70 views
1

我有從project tutorial下載的項目。我試圖用ionic serve運行這個離子2應用程序。我得到了錯誤。我該如何解決這個錯誤?運行IONIC 2項目時出錯

G:\alka\ionic-conference-app-master\ionic-conference-app-master>ionic serve 

> [email protected] ionic:serve G:\alka\ionic-conference-app-master\ionic-conference-app-master 
> ionic-app-scripts serve "--v2" "undefined" "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729" 

module.js:597 
    return process.dlopen(module, path._makeLong(filename)); 
       ^

Error: %1 is not a valid Win32 application. 
\\?\G:\alka\ionic-conference-app-master\ionic-conference-app-master\node_modules\node-sass\vendor\win32-x64-48\binding.node 
    at Error (native) 
    at Object.Module._extensions..node (module.js:597:18) 
    at Module.load (module.js:487:32) 
    at tryModuleLoad (module.js:446:12) 
    at Function.Module._load (module.js:438:3) 
    at Module.require (module.js:497:17) 
    at require (internal/module.js:20:19) 
    at module.exports (G:\alka\ionic-conference-app-master\ionic-conference-app-master\node_modules\node-sass\lib\binding.js:19:10) 
    at Object.<anonymous> (G:\alka\ionic-conference-app-master\ionic-conference-app-master\node_modules\node-sass\lib\index.js:14:35) 
    at Module._compile (module.js:570:32) 
npm ERR! code ELIFECYCLE 
npm ERR! errno 1 
npm ERR! [email protected] ionic:serve: `ionic-app-scripts serve "--v2" "undefined" "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729"` 
npm ERR! Exit status 1 
npm ERR! 
npm ERR! Failed at the [email protected] ionic:serve script 'ionic-app-scripts serve "--v2" "undefined" "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729"'. 
npm ERR! Make sure you have the latest version of node.js and npm installed. 
npm ERR! If you do, this is most likely a problem with the ionic-conference-app package, 
npm ERR! not with npm itself. 
npm ERR! Tell the author that this fails on your system: 
npm ERR!  ionic-app-scripts serve "--v2" "undefined" "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729" 
npm ERR! You can get information on how to open an issue for this project with: 
npm ERR!  npm bugs ionic-conference-app 
npm ERR! Or if that isn't available, you can get their info via: 
npm ERR!  npm owner ls ionic-conference-app 
npm ERR! There is likely additional logging output above. 

npm ERR! A complete log of this run can be found in: 
npm ERR!  C:\Users\Patoliya-1\AppData\Roaming\npm-cache\_logs\2017-04-27T05_55_17_136Z-debug.log 
There was an error serving your Ionic application: There was an error with the spawned command: serve 

波紋管我「的package.json」文件,

 "dependencies": { 
    "@angular/common": "4.0.2", 
    "@angular/compiler": "4.0.2", 
    "@angular/compiler-cli": "4.0.2", 
    "@angular/core": "4.0.2", 
    "@angular/forms": "4.0.2", 
    "@angular/http": "4.0.2", 
    "@angular/platform-browser": "4.0.2", 
    "@angular/platform-browser-dynamic": "4.0.2", 
    "@ionic-native/core": "3.5.0", 
    "@ionic-native/in-app-browser": "3.5.0", 
    "@ionic-native/splash-screen": "3.5.0", 
    "@ionic-native/status-bar": "3.5.0", 
    "@ionic/storage": "2.0.1", 
    "ionic-angular": "3.1.0", 
    "ionicons": "3.0.0", 
    "rxjs": "5.1.1", 
    "sw-toolbox": "3.4.0", 
    "zone.js": "^0.8.5" 
    }, 
    "devDependencies": { 
    "@ionic/app-scripts": "1.3.5", 
    "typescript": "~2.2.1" 
    }, 
    "config": {} 

回答

0

您需要在運行project.That將安裝之前運行npm i所有這些都需要爲您的項目node modules

+0

它也顯示錯誤爲'G:\ alka \ ionic-conference-app-master> npm i npm \ node_modules \ fsevents): npm WARN NOTSUP SKIPPING可選依賴:[email protected]不支持的平臺:wanted {「os」:「darwin」,「arch」:「any」}(current:{「os」:「 win32「,」arch「:」x64「})'' –

+0

這些是警告否?上述命令是否安裝節點模塊?請在您的文件路徑中查看。文件夾名稱應爲'node_modules',其中包含數百個文件夾。 – Sampath

+1

我試了這個'npm rm node-sass npm install node-sass',現在解決了。 –