Redturbo
Redturbo

Reputation: 1613

Ionic Framework gulp --cordova "prepare" failed

I want to build project from https://market.ionic.io/starters/nearme when try to gulp --cordova "prepare", this error always show :

Error: Hook failed with error code 127: projectname/app/hooks/after_prepare/update_platform_config.js

I have try answer from here, but it show same error, anybody can help ?

Upvotes: 3

Views: 2257

Answers (1)

danmullen
danmullen

Reputation: 2510

This is due to OSX ^M line endings.

Fix:

# check if the file has ^M line endings
cat -v FILE-NAME-WITH-ERROR

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

# check if problem fixed in resulting file from above
cat -v FILE-NAME-WITH-ERROR.fix

# overwrite original file with fixed file
mv FILE-NAME-WITH-ERROR.fix  FILE-NAME-WITH-ERROR

Upvotes: 5

Related Questions