env: node\r: No such file or directory Error: Hook failed error code 127 osx

If your getting the error message env: node\r: No such file or directory Error: Hook failed with error code 127 while trying to build your Ionic or Cordova application under OSX it's most likely due to the line ending format in the file in question.

The simplest way is to use dos2unix utility (can be install with brew install unix2dos), simply put it will covert the file from the Windows \r\n format to the Unix based \n.

For example if your have an issue with 010_add_platform_class.js you would simple run :-

unix2dos 010_add_platform_class.js
Filed under: Ionic, Cordova  Tags: Ionic

0 Responses to “env: node\r: No such file or directory Error: Hook failed error code 127 osx”

Sorry, comments have been closed for this post.
(default) 5 queries took 2 ms
NrQueryErrorAffectedNum. rowsTook (ms)
1SELECT `Post`.`id`, `Post`.`url`, `Post`.`title`, `Post`.`icon`, `Post`.`metadesc`, `Post`.`metakeys`, `Post`.`categories`, `Post`.`tease`, `Post`.`body`, `Post`.`private_body`, `Post`.`created`, `Post`.`modified`, `Post`.`status`, `Post`.`allow_comments`, `Post`.`tags`, `Post`.`hitcount`, `Post`.`hitcount_rss` FROM `posts` AS `Post` WHERE `Post`.`url` = 'env-node-r-no-such-file-or-directory-error-hook-failed-error-code-127-osx' LIMIT 1111
2SELECT `Comment`.`id`, `Comment`.`post_id`, `Comment`.`body`, `Comment`.`author`, `Comment`.`url`, `Comment`.`email`, `Comment`.`ip`, `Comment`.`status`, `Comment`.`junk_score`, `Comment`.`created`, `Comment`.`modified` FROM `comments` AS `Comment` WHERE `Comment`.`status` = 2 AND `Comment`.`post_id` = (116) 000
3SELECT `Tag`.`id`, `Tag`.`tag`, `PostsTag`.`post_id`, `PostsTag`.`tag_id` FROM `tags` AS `Tag` JOIN `posts_tags` AS `PostsTag` ON (`PostsTag`.`post_id` = 116 AND `PostsTag`.`tag_id` = `Tag`.`id`) 110
4SELECT `Category`.`id`, `Category`.`category`, `CategoriesPost`.`post_id`, `CategoriesPost`.`category_id` FROM `categories` AS `Category` JOIN `categories_posts` AS `CategoriesPost` ON (`CategoriesPost`.`post_id` = 116 AND `CategoriesPost`.`category_id` = `Category`.`id`) 220
5UPDATE `posts` AS `Post` SET `Post`.`hitcount` = Post.hitcount + 1 WHERE `Post`.`id` = 11611