我从项目教程下载了项目。我正在尝试使用ionic serve
运行此 ionic 2 应用程序。我得到的错误是波纹管。如何解决此错误?
G:alkaionic-conference-app-masterionic-conference-app-master>ionic serve
> ionic-conference-app@0.0.0 ionic:serve G:alkaionic-conference-app-masterionic-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:alkaionic-conference-app-masterionic-conference-app-masternode_modulesnode-sassvendorwin32-x64-48binding.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:alkaionic-conference-app-masterionic-conference-app-masternode_modulesnode-sasslibbinding.js:19:10)
at Object.<anonymous> (G:alkaionic-conference-app-masterionic-conference-app-masternode_modulesnode-sasslibindex.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:UsersPatoliya-1AppDataRoamingnpm-cache_logs2017-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": {}
您需要在运行项目之前运行npm i
。这将安装项目所需的所有node modules
。
你能尝试更新 Ionic CLI 吗?
npm uninstall -g ionic
npm install -g ionic
ionic -v
让我知道这是否可以解决它!