2015-08-11 15 views
12

Tôi đang cố gắng tìm hiểu công cụ nền tảng chéo ion. tôi có thiết lập điều cần thiết cho ví dụ ứng dụng ionic serve là làm việc tốt nhưng khi tôi cố gắng chạy sudo ionic build android hoặc sudo ionic run/emulate android nó trả về với thông báo lỗi.Nhận lỗi thông báo lỗi: sinh EACCES bằng cách sử dụng IONIC Framework

Error: spawn EACCES 
    at exports._errnoException (util.js:746:11) 
    at ChildProcess.spawn (child_process.js:1162:11) 
    at Object.exports.spawn (child_process.js:995:9) 
    at Object.exports.spawn (/usr/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:103:31) 
    at runScriptViaChildProcessSpawn (/usr/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:189:23) 
    at runScript (/usr/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:132:16) 
    at /usr/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:115:20 
    at _fulfilled (/usr/lib/node_modules/cordova/node_modules/q/q.js:787:54) 
    at self.promiseDispatch.done (/usr/lib/node_modules/cordova/node_modules/q/q.js:816:30) 
    at Promise.promise.promiseDispatch (/usr/lib/node_modules/cordova/node_modules/q/q.js:749:13) 

tôi không thể hiểu ý nghĩa của nó. tôi có google điều này nhưng sau khi appling tất cả những giải pháp tôi đã nhận lỗi tương tự. tôi sẽ rất biết ơn nếu có ai có thể cho tôi biết những gì đang xảy ra với tôi.

Trả lời

33

Sự cố xảy ra với lệnh 010_add_platform_class.js thiếu quyền thực thi.

Bạn có thể sử dụng chmod +x hooks/after_prepare/010_add_platform_class.js để cấp quyền thực thi.

Tôi đã tìm thấy giải pháp này trên diễn đàn khung Ionic tại liên kết bên dưới. http://forum.ionicframework.com/t/how-to-fix-this-error-spawn-eacces/20490/6

+1

Lệnh "cấp quyền" này không lo k đối với tôi, tôi vẫn gặp lỗi. –

3

Bạn có thể thử ionic hooks add nếu sửa chữa khác chưa từng làm việc

4

làm việc thành công

chmod +x hooks/after_prepare/010_add_platform_class.js 
+0

Câu trả lời này là một bản tóm tắt của câu trả lời ngày 31 tháng 8 năm 2015 của @ bkowshik (được bỏ phiếu nhiều nhất). – udog

2

Trong khi giải pháp được đưa đã đưa tôi một bước xa hơn, bổ sung thêm thực hiện quyền android sdk cũng là cần thiết.

chmod +x -R /home/username/Android/Sdk 

thấy Error: spawn EACCES when trying to build Ionic app in Ubuntu 15.10

+0

Yuck - làm cho toàn bộ sdk thực thi bao gồm các tệp cấu hình, tệp README, v.v. Có thể hạn chế điều này đối với các kịch bản lệnh shell>!>!>! Giải pháp này đã làm việc cho tôi, tuy nhiên, bằng cách chỉ làm cho tập lệnh gradlew có thể thực thi được – Chanoch

1

Tôi cố gắng này, nó làm việc

 chmod +x hooks/after_prepare/010_add_platform_class.js 
3

Trước tiên hãy thử để cho phép thực hiện vào một tập tin trong thư mục móc (010_add_platform_class.js), bạn có thể sử dụng lệnh này:

chmod +x hooks/after_prepare/010_add_platform_class.js 

Nếu nó không hoạt động, hãy thay đổi quyền của comp file lete trong thư mục sdk theo:

chmod +x -R /home/username/Android/Sdk 

Nếu bạn đang cài đặt gradle ở riêng biệt, cho phép đến thư mục đó cũng:

chmod +x -R /home/username/Android/gradle-2.3 
-1

Thử chạy này trong thư mục ứng dụng của bạn:

  • ionic hooks add
Các vấn đề liên quan