keystonejs / keystone-classic

Node.js CMS and web app framework
http://v4.keystonejs.com
MIT License
14.64k stars 2.21k forks source link

Extensive environment setup required for installation on Windows #1481

Closed Jonarod closed 8 years ago

Jonarod commented 9 years ago

Hello!! I am trying to deploy Keystone on Windows 8. I followed all the steps on the Docs. I went for the Yeoman Generator. Answered a bunch of questions. Then... ERROR! Seems like I need to install Python. (??!!) Installed Python, broadcast new environment variable 'PYTHON'. Launch Generator again... ERROR! Now I need Visual Studio !! (Ahah!!) Visual Studio needs Windows SDK which just costs 3.5Gb....

Is deployment on windows environment such "costly"? Do I really need those programs to get up and running? or is there a way I can bypass this?

I see you are updating documentation right now, so I would suggest to prepare people to install Python and all other friends... Or maybe... avoid Python?!! I don't have any idea if that's possible but I guess the aim of using Node.js is not to have to rely on other languages... am I wrong?

Thank you for your support !!!! ;p

JedWatson commented 9 years ago

Hi @Jonarod installation wasn't this expensive last time I ran through it on Windows, we may have new dependencies which require these things now though.

I believe you need Windows SDK to build C code from source for various packages (database drivers, file watching, etc)

Not sure what Python is required for, it's likely that this some dependency is needing it, would be interested to know which one.

Can anyone else chime in on total overhead setting up on Windows? Would be great to update the getting started process if so.

webteckie commented 9 years ago

@Jonarod have you looked at #1467 ? I typically only use "--msvs_version=2012" in my development environment (or whatever VS version...if you dont have one installed Microsoft provides a free community edition that you can download and install). But I may also have Python already setup and in the path...not sure. But I never have to explicitly tell it about python.

Jonarod commented 9 years ago

Hi! Thanks for your replies. The problem clearly comes from there : node-gyp Node-Gyp requires Python and Visual Studio on windows...

webteckie commented 9 years ago

FYI: I also experienced some npm install/build issues in windows with the latest keystone and its limax dependency. Eventually doing the following worked for me:

npm config set msvs_version 2012 --global
remove node_modules tree (e.g., rm -fr node_modules)
npm install
Jonarod commented 9 years ago

Here is what I have after:

*I downloaded visual studio express, and believe it or not, it's been 6h waiting to download and installing stuff... Unbelievable.

... [Yeoman Setup Questions] ... create package.json create .env create .jshintrc create keystone.js create .editorconfig create .gitignore create Procfile create gulpfile.js create models\User.js create models\Post.js create models\PostCategory.js create models\Gallery.js create models\Enquiry.js create routes\index.js create routes\middleware.js create routes\emails.js create routes\views\index.js create routes\views\blog.js create routes\views\post.js create routes\views\gallery.js create routes\views\contact.js create templates\layouts\default.jade create templates\mixins\flash-messages.jade create templates\views\errors\404.jade create templates\views\errors\500.jade create templates\views\index.jade create templates\views\blog.jade create templates\views\post.jade create templates\views\gallery.jade create templates\views\contact.jade create templates\emails\enquiry-notification.jade create updates\0.0.1-admins.js create public\fonts\glyphicons-halflings-regular.eot create public\fonts\glyphicons-halflings-regular.svg create public\fonts\glyphicons-halflings-regular.ttf create public\fonts\glyphicons-halflings-regular.woff create public\fonts\glyphicons-halflings-regular.woff2 create public\images\logo-email.gif create public\images\logo.svg create public\js\bootstrap\affix.js create public\js\bootstrap\alert.js create public\js\bootstrap\bootstrap-3.3.4.js create public\js\bootstrap\bootstrap-3.3.4.min.js create public\js\bootstrap\button.js create public\js\bootstrap\carousel.js create public\js\bootstrap\collapse.js create public\js\bootstrap\dropdown.js create public\js\bootstrap\modal.js create public\js\bootstrap\npm.js create public\js\bootstrap\popover.js create public\js\bootstrap\scrollspy.js create public\js\bootstrap\tab.js create public\js\bootstrap\tooltip.js create public\js\bootstrap\transition.js create public\js\jquery\jquery-1.11.2.js create public\js\jquery\jquery-1.11.2.min.js create public\js\jquery\jquery-2.1.3.js create public\js\jquery\jquery-2.1.3.min.js create public\favicon.ico create public\styles\bootstrap\alerts.less create public\styles\bootstrap\badges.less create public\styles\bootstrap\bootstrap.less create public\styles\bootstrap\breadcrumbs.less create public\styles\bootstrap\button-groups.less create public\styles\bootstrap\buttons.less create public\styles\bootstrap\carousel.less create public\styles\bootstrap\close.less create public\styles\bootstrap\code.less create public\styles\bootstrap\component-animations.less create public\styles\bootstrap\dropdowns.less create public\styles\bootstrap\forms.less create public\styles\bootstrap\glyphicons.less create public\styles\bootstrap\grid.less create public\styles\bootstrap\input-groups.less create public\styles\bootstrap\jumbotron.less create public\styles\bootstrap\labels.less create public\styles\bootstrap\list-group.less create public\styles\bootstrap\media.less create public\styles\bootstrap\mixins.less create public\styles\bootstrap\mixins\alerts.less create public\styles\bootstrap\mixins\background-variant.less create public\styles\bootstrap\mixins\border-radius.less create public\styles\bootstrap\mixins\buttons.less create public\styles\bootstrap\mixins\center-block.less create public\styles\bootstrap\mixins\clearfix.less create public\styles\bootstrap\mixins\forms.less create public\styles\bootstrap\mixins\gradients.less create public\styles\bootstrap\mixins\grid-framework.less create public\styles\bootstrap\mixins\grid.less create public\styles\bootstrap\mixins\hide-text.less create public\styles\bootstrap\mixins\image.less create public\styles\bootstrap\mixins\labels.less create public\styles\bootstrap\mixins\list-group.less create public\styles\bootstrap\mixins\nav-divider.less create public\styles\bootstrap\mixins\nav-vertical-align.less create public\styles\bootstrap\mixins\opacity.less create public\styles\bootstrap\mixins\pagination.less create public\styles\bootstrap\mixins\panels.less create public\styles\bootstrap\mixins\progress-bar.less create public\styles\bootstrap\mixins\reset-filter.less create public\styles\bootstrap\mixins\resize.less create public\styles\bootstrap\mixins\responsive-visibility.less create public\styles\bootstrap\mixins\size.less create public\styles\bootstrap\mixins\tab-focus.less create public\styles\bootstrap\mixins\table-row.less create public\styles\bootstrap\mixins\text-emphasis.less create public\styles\bootstrap\mixins\text-overflow.less create public\styles\bootstrap\mixins\vendor-prefixes.less create public\styles\bootstrap\modals.less create public\styles\bootstrap\navbar.less create public\styles\bootstrap\navs.less create public\styles\bootstrap\normalize.less create public\styles\bootstrap\pager.less create public\styles\bootstrap\pagination.less create public\styles\bootstrap\panels.less create public\styles\bootstrap\popovers.less create public\styles\bootstrap\print.less create public\styles\bootstrap\progress-bars.less create public\styles\bootstrap\responsive-embed.less create public\styles\bootstrap\responsive-utilities.less create public\styles\bootstrap\scaffolding.less create public\styles\bootstrap\tables.less create public\styles\bootstrap\theme.less create public\styles\bootstrap\thumbnails.less create public\styles\bootstrap\tooltip.less create public\styles\bootstrap\type.less create public\styles\bootstrap\utilities.less create public\styles\bootstrap\variables.less create public\styles\bootstrap\wells.less create public\styles\site.less create public\styles\site\layout.less create public\styles\site\variables.less npm WARN peerDependencies The peer dependency browserify@>= 2.3.0 < 11 included from browserify-shim will no npm WARN peerDependencies longer be automatically installed to fulfill the peerD ependency npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly. npm WARN optional dep failed, continuing fsevents@0.3.6 /

kerberos@0.0.9 install C:\Users\Jona\Projects\Web\KeyStoneJS\my-site\node_modu les\keystone\node_modules\mongoose\node_modules\mongodb\node_modules\kerberos (node-gyp rebuild 2> builderror.log) || (exit 0)

C:\Users\Jona\Projects\Web\KeyStoneJS\my-site\node_modules\keystone\node_modules \mongoose\node_modules\mongodb\node_modules\kerberos>if not defined npm_config_n ode_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin....\ node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (rebuild) Génération des projets individuellement dans cette solution. Pour activer la gén ération en parallèle, ajoutez le commutateur "/m". C:\Users\Jona\Projects\Web\KeyStoneJS\my-site\node_modules\keystone\node_module s\mongoose\node_modules\mongodb\node_modules\kerberos\build\kerberos.vcxproj(18 ,3): error MSB4019: Le projet importé "C:\Microsoft.Cpp.Default.props" est intr ouvable. Vérifiez que le chemin d'accès dans la déclaration est correc

t et que le fichier existe sur le disque.

bson@0.2.21 install C:\Users\Jona\Projects\Web\KeyStoneJS\my-site\node_modules \keystone\node_modules\mongoose\node_modules\mongodb\node_modules\bson (node-gyp rebuild 2> builderror.log) || (exit 0)

C:\Users\Jona\Projects\Web\KeyStoneJS\my-site\node_modules\keystone\node_modules \mongoose\node_modules\mongodb\node_modules\bson>if not defined npm_confignode gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin....\node _modules\node-gyp\bin\node-gyp.js" rebuild ) else (rebuild) Génération des projets individuellement dans cette solution. Pour activer la gén ération en parallèle, ajoutez le commutateur "/m". C:\Users\Jona\Projects\Web\KeyStoneJS\my-site\node_modules\keystone\node_module s\mongoose\node_modules\mongodb\node_modules\bson\build\bson.vcxproj(18,3): err or MSB4019: Le projet importé "C:\Microsoft.Cpp.Default.props" est introuvable. Vérifiez que le chemin d'accès dans la déclaration est correct et que le fichier existe sur le disque. |

cld@2.4.2 install C:\Users\Jona\Projects\Web\KeyStoneJS\my-site\node_modules\k eystone\node_modules\keystone-utils\node_modules\limax\node_modules\cld node-gyp rebuild

C:\Users\Jona\Projects\Web\KeyStoneJS\my-site\node_modules\keystone\node_modules \keystone-utils\node_modules\limax\node_modules\cld>if not defined npm_config_no de_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin....\n ode_modules\node-gyp\bin\node-gyp.js" rebuild ) else (rebuild) Génération des projets individuellement dans cette solution. Pour activer la gén ération en parallèle, ajoutez le commutateur "/m". C:\Users\Jona\Projects\Web\KeyStoneJS\my-site\node_modules\keystone\node_module s\keystone-utils\node_modules\limax\node_modules\cld\build\deps\cld\cld-c.vcxpr oj(18,3): error MSB4019: Le projet importé "C:\Microsoft.Cpp.Default.props" est introuvable. Vérifiez que le chemin d'accès dans la déclaration est c orrect et que le fichier existe sur le disque. gyp ERR! build error gyp ERR! stack Error: C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe failed with exit code: 1 gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\ npm\node_modules\node-gyp\lib\build.js:269:23) gyp ERR! stack at ChildProcess.emit (events.js:110:17) gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:1074 :12) gyp ERR! System Windows_NT 6.3.9600 gyp ERR! command "node" "C:\Program Files\nodejs\node_modules\npm\node_modu les\node-gyp\bin\node-gyp.js" "rebuild" gyp ERR! cwd C:\Users\Jona\Projects\Web\KeyStoneJS\my-site\node_modules\keystone \node_modules\keystone-utils\node_modules\limax\node_modules\cld gyp ERR! node -v v0.12.3 gyp ERR! node-gyp -v v1.0.3 gyp ERR! not ok npm ERR! Windows_NT 6.3.9600 npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs \node_modules\npm\bin\npm-cli.js" "install" npm ERR! node v0.12.3 npm ERR! npm v2.9.1 npm ERR! code ELIFECYCLE

npm ERR! cld@2.4.2 install: node-gyp rebuild npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the cld@2.4.2 install script 'node-gyp rebuild'. npm ERR! This is most likely a problem with the cld package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node-gyp rebuild npm ERR! You can get their info via: npm ERR! npm owner ls cld npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request: npm ERR! C:\Users\Jona\Projects\Web\KeyStoneJS\my-site\npm-debug.log


Your KeystoneJS project is ready to go!

For help getting started, visit http://keystonejs.com/guide

We've included a test Mandrill API Key, which will simulate email sending but not actually send emails. Please replace it with your own when you are ready.

We've included a demo Cloudinary Account, which is reset daily. Please configure your own account or use the LocalImage field instead before sending your site live.

To start your new website, run "cd my-site" then "node keystone".

C:\Users\Jona\Projects\Web\KeyStoneJS>node keystone module.js:338 throw err; ^ Error: Cannot find module 'C:\Users\Jona\Projects\Web\KeyStoneJS\keystone' at Function.Module._resolveFilename (module.js:336:15) at Function.Module._load (module.js:278:25) at Function.Module.runMain (module.js:501:10) at startup (node.js:129:16) at node.js:814:3

C:\Users\Jona\Projects\Web\KeyStoneJS>

webteckie commented 9 years ago

@Jonarod That's the exact error I was getting! I recommend that in windows you use Git Bash (https://msysgit.github.io/) to do your npm commands--and you should run it in Admin mode. In fact, I've found that I cannot remove node_modules in windows because of some humongous node_modules path keystone has and none of the tools (including windows native delete and/or Git Bash) that I've tried can delete it. However, cygwin can! So I also use cygwin for rare things like that.

shailendra735 commented 9 years ago

Any updates on this? I'm still unable to setup keystone on my Windows 8 machine. It works perfectly fine on mac though.

Jonarod commented 9 years ago

Hi! I tried everything stated in this thread in nothing worked for me.

I have to admit I gave up after 4h of unsuccessful attempts to install Visual Studio Express. Also, like I said in the beginning : I am not really appealed to have to use third-party languages to make node to work. So given all those "flags" I decided to skip using Keystone which I sadly regret... :-/ If someone finally finds a solution to avoid installing Python + Visual Studio on Windows 8, the premises of KeyStone are so cool that I'll be thrilled to give it a new try! :)

P.S: I think we could close the thread and just update the docs to update requirements before install, what do you guys think ?

webteckie commented 9 years ago

@Jonarod it seems the issues you are having may be particular to visual studio? Have you tried visual studio community edition? I believe it has some advantages over the express version and it is cross-platform. Also once you install these things once you never have to touch them, unless you want/need to upgrade them. Also, not sure if anyone has tried using cygwin to build/install keystone in windows. Last, but not least, you would most likely have the same issues in linux/mac if these had not the dev tools (like make) installed.

kmattimo commented 9 years ago

I was able to get around a lot of the node-gyp building issues by installing npm3 (3.2 as of now) which is much more windows friendly. It's currently pre-release so you have to specify the version to install. If you're getting build errors, rather than visual studio 'not found' errors, it's definitely worth a try.

paulchabotca commented 8 years ago

@Jonarod What version of windows are you using. @JedWatson Would be happy to go through getting it setup on windows and writing documentation for it. Any particular versions?

mxstbr commented 8 years ago

That would be amazing and highly appreciated @paulchabotca! Whatever versions you have available work, I personally think, based on usage stats I have at the back of my head, Windows 7, 8 and 10 are the very max that we should support. (correct me if I'm wrong)

mxstbr commented 8 years ago

I'll close this for now since we didn't hear back from @paulchabotca yet, I'd still love to have that documentation though!