2016-11-23 75 views
-1

我正在研究離子項目。一切都很好,直到我沒有更新Mac機的離子和cordova Mac OS X EI Capitan 10.11.2。更新此組件後我不能運行離子構建IOS和它給錯誤,所以我試圖刪除平臺並再次添加它,但它給定下面的錯誤,現在我無法繼續'node r node no such file or directory'while running ion platform add ios

env: node\r: No such file or directory Error: Hook failed with error code 127: /hooks/after_prepare/010_add_platform_class.js

哪有我克服這一個?

回答

0

做了一些研究之後,我得出一個解決方案在以下鏈接 https://forum.ionicframework.com/t/error-hook-failed-with-error-code-127/12236

Issue

This is due to to OSX ^M line endings that were committed to my project in this file. For some reason they seem to pop up in this file only, although I have seen some SO posts where people are having the problem on other node scripts.

檢查,如果該文件有^ M行結束

cat -v FILE-NAME-WITH-ERROR

修復該文件

tr -d '\r' < FILE-NAME-WITH-ERROR > FILE-NAME-WITH-ERROR.fix

檢查,如果固定在問題產生的文件從上述

cat -v FILE-NAME-WITH-ERROR.fix

覆寫原始文件具有固定的文件

mv FILE-NAME-WITH-ERROR.fix FILE-NAME-WITH-ERROR

不僅after_platform_class.js文件,但在其他文件如 install_plugin.js, register_plugin.js, deregister_plugin.js中的錯誤也可以通過此解決方案解決

相關問題