欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Ionic Build 时候出现了 Error: spawn EACCES 博客分类: 前端大全 iosionicandroid 

程序员文章站 2024-03-14 18:06:34
...



$ ionic platform add ios
Adding ios project...


Creating Cordova project for the iOS platform:


	Path: platforms/ios

	Package: io.ionic.starter
	Name: V2 Test

iOS project created with cordova-ios@4.2.0


Running command: /Users/nishurong/PhpstormProjects/ionic-workspace/H5APP/hooks/after_prepare/010_add_platform_class.js /Users/nishurong/PhpstormProjects/ionic-workspace/H5APP


Error: spawn EACCES


$ ionic platform add ios
Adding ios project...
 
 
Creating Cordova project for the iOS platform:
 
 
	Path: platforms/ios
 
	Package: io.ionic.starter
	Name: V2 Test
 
iOS project created with cordova-ios@4.2.0
 
 
Running command: /Users/nishurong/PhpstormProjects/ionic-workspace/H5APP/hooks/after_prepare/010_add_platform_class.js /Users/nishurong/PhpstormProjects/ionic-workspace/H5APP
 
 
Error: spawn EACCES



解决方案是:

$ ionic hooks add
Adding in default Ionic Cordova hooks
Added default Ionic Cordova hooks


然后继续执行add ios,即可。

注意,先进入platforms目录,如果存在ios目录,先删除掉,否则,执行run ios命令的时候,会出现下面的错误:

/Users/xueron/PhpstormProjects/ionic-workspace/H5APP/platforms/ios/V2 Test/Classes/MainViewController.h:28:9: fatal error: 'Cordova/CDVViewController.h' file not found
#import <Cordova/CDVViewController.h>
        ^
1 error generated.




相关标签: ios ionic android