我从project tutorial下载了项目。我正在尝试使用ionic serve
来运行这个离子2应用程序。我得到的错误如下所示。我该如何解决这个错误?
G:\alka\ionic-conference-app-master\ionic-conference-app-master>ionic serve
> ionic-conference-app@0.0.0 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! ionic-conference-app@0.0.0 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 ionic-conference-app@0.0.0 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
贝罗是我的&#39; package.json&#39;文件,
"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 :(得分:0)
您需要在运行项目之前运行npm i
。这将安装项目所需的所有node modules
。
答案 1 :(得分:0)
能否请您尝试更新Ionic CLI?
npm uninstall -g ionic
npm install -g ionic
ionic -v
让我知道是否可以解决问题!