andrewminer / crafting-guide

The ultimate step-by-step guide to make anything in Minecraft
http://crafting-guide.com
66 stars 192 forks source link

Unable to get environment setup on Windows. #260

Open Landelor opened 8 years ago

Landelor commented 8 years ago

Wasn't sure if you read closed issues. This is the current state of things.

$ grunt clean build start
Running "clean:assets" (clean) task
>> 1 path cleaned.

Running "clean:build" (clean) task
>> 1 path cleaned.

Running "clean:dist" (clean) task
>> 0 paths cleaned.

Running "clean:templates" (clean) task
>> 1 path cleaned.

Running "jade:pages" (jade) task
>> 1 file created.

Running "jade:templates" (jade) task
>> 1 file created.

Running "copy:assets_build" (copy) task
Created 2 directories, copied 25 files

Running "copy:env_build" (copy) task

Running "copy:common_source" (copy) task
Copied 4 files

Running "copy:server_source" (copy) task
Copied 4 files

Running "sass_globbing:all" (sass_globbing) task

Running "sass:all" (sass) task

Running "browserify:external" task

Running "browserify:internal" task

Running "script:start" task
Fatal error: spawn .\scripts\start ENOENT
+ nodemon ./server.coffee
[nodemon] 1.9.2
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: *.*
[nodemon] starting `coffee.cmd ./server.coffee`
Running "watch" task
Waiting...
{ Error: ENOENT: no such file or directory, open 'C:\Crafting-Guide\crafting-guide\build\.env'
  at Error (native)
  at Object.fs.openSync (fs.js:634:18)
  at Object.fs.readFileSync (fs.js:502:33)
  at Object.module.exports.config (C:\Crafting-Guide\crafting-guide\node_modules\dotenv\lib\main.js:30:37)
  at Object.<anonymous> (C:\Crafting-Guide\crafting-guide\build\server.coffee:8:19)
  at Object.<anonymous> (C:\Crafting-Guide\crafting-guide\build\server.coffee:8:1)
  at Module._compile (module.js:541:32)
  at Object.exports.run (C:\Users\rpiketh\AppData\Roaming\npm\node_modules\coffee-script\lib\coffee-script\coffee-script.js:134:23)
  at compileScript (C:\Users\rpiketh\AppData\Roaming\npm\node_modules\coffee-script\lib\coffee-script\command.js:224:29)
  at compilePath (C:\Users\rpiketh\AppData\Roaming\npm\node_modules\coffee-script\lib\coffee-script\command.js:174:14)
  at Object.exports.run (C:\Users\rpiketh\AppData\Roaming\npm\node_modules\coffee-script\lib\coffee-script\command.js:98:20)
  at Object.<anonymous> (C:\Users\rpiketh\AppData\Roaming\npm\node_modules\coffee-script\bin\coffee:7:41)
  at Module._compile (module.js:541:32)
  at Object.Module._extensions..js (module.js:550:10)
  at Module.load (module.js:458:32)
  at tryModuleLoad (module.js:417:12)
  at Function.Module._load (module.js:409:3)
  at Module.runMain (module.js:575:10)
  at run (node.js:348:7)
  at startup (node.js:140:9)
  at node.js:463:3

  errno: -4058,
  code: 'ENOENT',
  syscall: 'open',
  path: 'C:\\Crafting-Guide\\crafting-guide\\build\\.env' }
Error: port is mandatory
  at new CraftingGuideServer (C:\Crafting-Guide\crafting-guide\build\crafting_guide_server.coffee:18:37)
  at Object.<anonymous> (C:\Crafting-Guide\crafting-guide\build\server.coffee:19:14)
  at Object.<anonymous> (C:\Crafting-Guide\crafting-guide\build\server.coffee:8:1)
  at Module._compile (module.js:541:32)
  at Object.exports.run (C:\Users\rpiketh\AppData\Roaming\npm\node_modules\coffee-script\lib\coffee-script\coffee-script.js:134:23)
  at compileScript (C:\Users\rpiketh\AppData\Roaming\npm\node_modules\coffee-script\lib\coffee-script\command.js:224:29)
  at compilePath (C:\Users\rpiketh\AppData\Roaming\npm\node_modules\coffee-script\lib\coffee-script\command.js:174:14)
  at Object.exports.run (C:\Users\rpiketh\AppData\Roaming\npm\node_modules\coffee-script\lib\coffee-script\command.js:98:20)
  at Object.<anonymous> (C:\Users\rpiketh\AppData\Roaming\npm\node_modules\coffee-script\bin\coffee:7:41)
  at Module._compile (module.js:541:32)
  at Object.Module._extensions..js (module.js:550:10)
  at Module.load (module.js:458:32)
  at tryModuleLoad (module.js:417:12)
  at Function.Module._load (module.js:409:3)
  at Module.runMain (module.js:575:10)
  at run (node.js:348:7)
  at startup (node.js:140:9)
  at node.js:463:3

[nodemon] app crashed - waiting for file changes before starting...

As a side note. I had to manually install Ruby, Sass and nodemon for the Windows environment.

Regards.

Landelor commented 8 years ago

After some troubleshooting downloaded an earlier tree. Found out that Tree:b34ca26d0a works fine. Hope that helps.

andrewminer commented 8 years ago

Nice troubleshooting! Looks like there are a few more things which need updating in the documentation. I think the one thing you're missing is a file named .env containing:

WEBSITE_SERVER_PORT=8080
andrewminer commented 8 years ago

I've updated the documentation. If you don't mind, could you look it over to see if there any steps you needed to add which aren't reflected there?

Landelor commented 8 years ago

That looks good. Works now. However still getting an error when using $ grunt clean build start. Have to run the script manually ./scripts/start for it to go.

Also the URL in the doc is still showing port 8000.

I'll do this from scratch again on a different box and let you know if there are any steps missing.

Cheers,

Landelor commented 8 years ago

Flows nicely doing it from scratch. Only issue left is the error when running $ grunt clean build start

Running "script:start" task
Fatal error: spawn .\scripts\start ENOENT
andrewminer commented 8 years ago

Huh. Those backslashes make it look like you're running that on Windows. Does dir .\scripts\start show up as a proper file?

Landelor commented 8 years ago

Running it on Git for Windows yes. I can see the start file in the scripts directory.

andrewminer commented 8 years ago

I'm baffled, then. This is the exact line where the problem is coming from. All I can suggest is that you try messing around with various ways of getting it to call that script. Unfortunately, I don't have access to a Windows machine to test things out on. 😢

Landelor commented 8 years ago

From what I can find it seems to be a problem with grunt spawn not working well/at all on windows. There are some variants for Windows "win-spawn", "cross-spawn". Unfortunately my coding knowledge is rudimentary and I have no idea how I would implement one of those in this case.

andrewminer commented 8 years ago

Thanks for figuring that out! I might upgrade the project at some point, but, for now, I'll update the docs to tell people to just run the script manually.

Landelor commented 8 years ago

Sounds good.

GreenGhost21 commented 7 years ago

Apologies for the necro, but I think it should be mentioned that you need to run $ grunt clean build start once in order for ./scripts/start to work. Adding that one line to the wiki instructions ought to save potential contributors a headache.

ElfLeaderMike commented 6 years ago

@GreenGhost21 Jesus dude you just saved my life, I was following the documentation to the letter and started over a bunch before finding this.

@andrewminer Definitely update the documentation saying that $ grunt clean build start has to be run once before doing ./scripts/start

andrewminer commented 6 years ago

Done. Thanks for troubleshooting, guys!

chall8908 commented 6 years ago

In going through the setup, I encountered two serious issues. For reference, I'm using the Linux Subsystem for Windows.

1) Version pinning for crafting-guide-common is too lax. NPM installed a version old enough (5.6.0) to not work with the current master branch. I had to manually upgrade to the latest version.

2) The data directory isn't linked over correctly in any of the setup steps. I had to manually symlink crafting-guide-data/data to crafting-guide/build/static/data before I could get it working. I notice you mention rsync in the documentation but never include a setup step for it.

As an addition to this, you should maybe mention that running ./scripts/start is only necessary if grunt start doesn't work.

EDIT: it's possible that the windows command mklink may also work instead of rsync.