做了一些研究之後,我得出一個解決方案在以下鏈接 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
中的錯誤也可以通過此解決方案解決