react-webpack-generators / generator-react-webpack

Yeoman generator for ReactJS and Webpack
http://newtriks.com/2013/12/31/automating-react-with-yeoman-and-grunt/
MIT License
2.88k stars 355 forks source link

Project generates files outside of directory #230

Open ghost opened 8 years ago

ghost commented 8 years ago

I just installed this generator and when I run it inside a given directory it starts generating some of its files outside of the directory into its parent directory.

Example: mkdir my-super-cool-project && cd my-super-cool-project ls Desktop/my-super-cool-project yo react-webpack

It puts some of the files in the project folder and dumps other files into the parent directory, in this case the Desktop.

ghost commented 8 years ago

Seems like it is only doing it when you are on the Desktop in OSX. I moved to the documents folder and made a new folder and ran the generator and it worked correctly.

weblogixx commented 8 years ago

@alexbahl,

maybe this is related to some kind of symlink error? Will investigate in this.

dannguyen commented 8 years ago

I tried doing this in a subfolder in /tmp and had the issue of everything installing inside of /tmp

weblogixx commented 8 years ago

Hi @dannguyen,

interesting, I do not have the same problem in /tmp (latest osx, node installed via nvm, version 6.2, with generator and yeoman installed globally).

Could you please send me your npm and node versions? Also, did you install node globally (e.g. from nodes website) or via a version management system (nvm?). Thank you for your answers.

dannguyen commented 8 years ago

@weblogixx I should have mentioned...when I switched to a subdirectory in ~/Downloads and ran the generator then, things were placed as they should be, inside the subdirectory. I would have said that the bug I had with /tmp would seem to be the result of installing from a top-level path versus a user-level path if it were not for alex's earlier comment, which saw the problem at ~/Desktop/path...however, I just tried installing into a subdirectory off my Desktop and things worked fine! So it's hard to imagine the bug not being related to individual systems...

I'd provide more information right now but I've just recently started getting back into Node...it's been so long that I don't really remember how I installed everything (other than starting with brew install node)...my purpose of using the yo-react-webpack generator was just to see what a conventional scaffold looked like, as I started experimenting with react and webpack on my own. So while I do have some idea about what I'm doing with node, I'm certain to have a staggering amount of ignorance about node and npm, on top of whatever eccentricities my system config has :)

I'll get back to you over the weekend after I've had some time to just clean things out and start from scratch. But if other people aren't running into the same issue than I'm thinking that I'm the problem

weblogixx commented 8 years ago

@dannguyen,

thank you for your detailed report and help. I am still not able to reproduce this error, but wont close it for now. I have some other systems where I may test it, but had no problems so far. It could also be related to something yeoman-internal, will have a look if there is a known issue there.

masterfung commented 8 years ago

I had the same issue where it would install one directory up but adding a dot at the end seemed to resolve my issue when I cd and run the generator

JakeBernstein65 commented 8 years ago

I had a similar problem earlier. Try running the command 'yo doctor'. It notified me that I had the file '.yo-rc.json' in the incorrect place, and that's what was causing all my files to be installed in the parent directory.

iamplugged commented 7 years ago

Facing the same issue.