scottrod
scottrod

Reputation: 597

Yeoman returns 'env: node\r: No such file or directory'

I've followed these instructions to installing Yeoman. Everything is fine until I cd into the directory and execute yo webappfrom the terminal (Also tried sudo yo webapp). It returns env: node\r: No such file or directory and I never reach the step to choose the kind of web app. Any ideas? On Mac Os 10.9. Updated Ruby, Node.js, Git. And from what I've read Yeoman installs Grunt and Bower.

Upvotes: 2

Views: 3396

Answers (3)

AzureLeon
AzureLeon

Reputation: 1

open the script with vim.

:set ff=unix to modify the format of the file.

:wq! to save and exit.

Upvotes: -1

RichardSJust
RichardSJust

Reputation: 106

I just came across this for a different project. I fixed it by opening the executing .js file (/usr/local/lib/node_modules/[project_name]/bin/[executing.js]) in vim and using the following command

:set ff=unix

Upvotes: 2

jbielick
jbielick

Reputation: 3133

Looks like the version of Yeoman you had back when this was asked used windows newlines \r\n. Because of this, at the top of the file, #!/usr/bin/env node actually resulted in the shell trying to run a command called node\r. (Note the carriage return on the end).

This is probably fixed by now, but this isn't a node issue, it's a windows-newlines-in-osx issue. The carriage returns should be replaced with \n newline characters.

Upvotes: 1

Related Questions