2015-03-06 26 views
6

Sau khi cập nhật lên phiên bản 4.3.0 cordova lệnh:Cordova 4.3.0 - xây dựng lệnh trở về lỗi không thể tìm thấy mô-đun 'Q'

cordova build 

trả về lỗi sau:

module.js:340 
    throw err; 
     ^
Error: Cannot find module 'Q' 
    at Function.Module._resolveFilename (module.js:338:15) 
    at Function.Module._load (module.js:280:25) 
    at Module.require (module.js:364:17) 
    at require (module.js:380:17) 
    at Object.<anonymous> (/Volumes/CaseSensitive/ios_projects/_Tests/testGruntCordova/testGruntCordova/platforms/ios/cordova/lib/check_reqs.js:25:13) 
    at Module._compile (module.js:456:26) 
    at Object.Module._extensions..js (module.js:474:10) 
    at Module.load (module.js:356:32) 
    at Function.Module._load (module.js:312:12) 
    at Module.require (module.js:364:17) 
ERROR building one of the platforms: Error: /Volumes/CaseSensitive/ios_projects/_Tests/testGruntCordova/testGruntCordova/platforms/ios/cordova/build: Command failed with exit code 8 
You may not have the required environment or OS to build this project 
Error: /Volumes/CaseSensitive/ios_projects/_Tests/testGruntCordova/testGruntCordova/platforms/ios/cordova/build: Command failed with exit code 8 
    at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:131:23) 
    at ChildProcess.EventEmitter.emit (events.js:98:17) 
    at maybeClose (child_process.js:753:16) 
    at Process.ChildProcess._handle.onexit (child_process.js:820:5) 

Tôi có đã cố gắng loại bỏ và thêm ios nền tảng nhưng không có gì thay đổi.

Tôi đã cố gắng để chạy:

sudo npm install -g cordova/sudo npm install cordova 
sudo npm install -g Q/sudo npm install Q 

nhưng có gì thay đổi.

Bất kỳ trợ giúp nào? Thank you very much

Trả lời

1

Đây là một lỗi hiển thị trên hệ thống trường nhạy cảm như Unix, Linux và một số OS X (nếu được đặt là phân biệt chữ hoa chữ thường).

Cho đến nay, để sửa chữa nó, bạn phải xác định vị trí các tập tin có chứa một dòng như thế này:

Q = require('Q') 

Bạn có thể xác định vị trí các tập tin khi đứng trên thư mục dự án của bạn sử dụng grep:

grep -HnrI "require('Q" *; 

sau đó, sử dụng bất kỳ trình soạn thảo văn bản nào để thay đổi dòng được đề cập theo cách thủ công thành:

Q = require('q') 

bạn có thể chỉnh sửa các tệp có liên quan theo cách thẳng tiến hơn bằng cách chạy lệnh sau trên thư mục dự án của bạn:

grep -rl "require('Q" * | xargs sed -i "" "s/'Q'/'q'/g"; 

Dòng đơn ở trên tìm kiếm và chỉnh sửa tệp cần thay đổi.

0

Loại bỏ và sau đó lại thêm một lần nữa nền tảng này cũng làm việc:

cordova platform remove ios 
cordova platform add ios 

Bây giờ bạn có thể cordova build ios :)

Như đã đề cập bởi MeV đây là một lỗi.

Các vấn đề liên quan