I've followed these instructions to
installing Yeoman. Everything is fine until I cd into the directory and execute yo webapp
from 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.
Asked
Active
Viewed 3,384 times
2

scottrod
- 477
- 1
- 8
- 21
-
Looks like it might be the same problem as this: http://stackoverflow.com/questions/18431107/using-yeoman-from-intellij-idea-12 ? Related to node being in the path? OSX installs node into `/usr/local/bin/node` – brandonscript Dec 10 '13 at 00:46
-
Yes, indeed it does. I think there needs to be a special video tut for us Mac rejects on how to properly install Yeoman. I did install node and npm via Mac package installer instead via terminal. And Yeoman via terminal. So, what's the easiest way to rectify the situation so everything plays nice? – scottrod Dec 10 '13 at 01:17
-
I have successfully verified the existence of node, npm, grunt and bower to be installed and current by checking `bower --version` for example. But, if I check `yo --version` it gives me the same error. Yet, I didn't receive any errors upon installation. And I see it here: `/usr/local/bin/yo` So, it's there…? – scottrod Dec 10 '13 at 02:39
-
Think the best bet is for you to remove all of them and the install Node via source. – brandonscript Dec 10 '13 at 03:34
-
See the answer on this SO question: http://stackoverflow.com/questions/20504891/yeoman-install-node-path-issues – Stephen Dec 11 '13 at 12:06
-
Thanks a bunch @Stephen That article solved the problem. Turned out to be Windows line endings in the file that had been published. – scottrod Dec 11 '13 at 23:51
3 Answers
2
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

RichardSJust
- 106
- 1
- 10
1
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.

jbielick
- 2,800
- 17
- 28
-1
open the script with vim.
:set ff=unix
to modify the format of the file.
:wq!
to save and exit.

AzureLeon
- 1
- 1