Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows Installation Fails #49

Open
srcspider opened this issue Mar 22, 2014 · 36 comments
Open

Windows Installation Fails #49

srcspider opened this issue Mar 22, 2014 · 36 comments

Comments

@srcspider
Copy link

Version: 0.4.8 (node v0.10.26, npm 1.4.3, platform: win32)

'C:\Program' is not recognized as an internal or external command,
operable program or batch file.
Could not fetch project from https://github.com/hoodiehq/my-first-hoodie.git

I have a pretty good idea looking at the C:\Program what the error is. But I'm sure you know where it is and how to fix it. For reference, windows 7 x64, git bash:

$ where git
C:\Program Files (x86)\Git\bin\git.exe
$ where npm
c:\Program Files\nodejs\npm
c:\Program Files\nodejs\npm.cmd
$ git --version
git version 1.9.0.msysgit.0
$ npm -version
1.4.3
@gr2m
Copy link
Contributor

gr2m commented Mar 22, 2014

cc @Acconut

@Acconut
Copy link

Acconut commented Mar 22, 2014

Well, that's a wired issue. Normally this should be prevented by https://github.com/hoodiehq/hoodie-cli/blob/master/lib/hoodie/util/git.js#L9. I assume you have executed hoodie new app, haven't you?

@srcspider
Copy link
Author

Yes.

@Acconut
Copy link

Acconut commented Mar 22, 2014

Have you tried it using the default command line on windows (cmd.exe)? I was unable to reproduce your issue.

@srcspider
Copy link
Author

I just tried it now. Same issue.

I would like to point out that I've never seen anyone actually use the cmd.exe command line for actual "work" on windows, ever. It's always some alternative command line such as a dresser program, power shell (or whatever it's called), cygwin equivalent, etc.

I'll try and diagnose it for you since I have some time. [edit] In my hoodie-cli located at C:\Users\srcspider\AppData\Roaming\npm\node_modules\hoodie-cli\lib\hoodie\util I do not actually have a git.js file as the example you just linked. For reference using these install instructions: http://hood.ie/#installation Re-installed and still don't see it. This might be the issue, note the WARN there:

@janl
Copy link
Contributor

janl commented Mar 22, 2014

The warn is harmless, but can you try running npm install inside your app directory?

On 22.03.2014, at 22:34, srcspider [email protected] wrote:

I just tried it now. Same issue.

I would like to point out that I've never seen anyone actually use the cmd.exe command line for actual "work" on windows, ever. It's always some alternative command line such as a dresser program, power shell (or whatever it's called), cygwin equivalent, etc.

I'll try and diagnose it for you since I have some time. [edit] In my hoodie-cli located at C:\Users\srcspider\AppData\Roaming\npm\node_modules\hoodie-cli\lib\hoodie\util I do not actually have a git.js file as the example you just linked. For reference using these install instructions: http://hood.ie/#installation Re-installed and still don't see it. This might be the issue, note the WARN there:

$ npm install -g hoodie-cli
...
npm WARN package.json [email protected] No repository field.
[email protected] C:\Users\srcspider\AppData\Roaming\npm\node_modules\hoodie-cli
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected])
└── [email protected]

Reply to this email directly or view it on GitHub.

@Acconut
Copy link

Acconut commented Mar 22, 2014

Ok, the problem is that the version published on npm doesn't include the necessary fix (https://github.com/hoodiehq/hoodie-cli/commit/301958229c911b2cd00216690c50d050995da7e1).Until someone publishes the latest version you need to install it from GitHub: npm install -g git://github.com/hoodiehq/hoodie-cli.git

This is why we need hoodiehq/discussion#19

@srcspider
Copy link
Author

The url for the fix is invalid @Acconut

@Acconut
Copy link

Acconut commented Mar 22, 2014

Fixed, thanks

@srcspider
Copy link
Author

Tested and workaround works on my end.

That said hoodie start fails at fs.js:427 with Error: ENOENT, no such file or directory 'e:\testproj2\data\couch.pid'. CouchDB is installed according to default instructions and unless I'm interpreting it wrong the futon web interface seems to indicate everything about it is working. Is there anything I'm missing? Since your instructions specify default behavior should work out of the box and configuration instructions for couchdb itself should not be required.

@Acconut
Copy link

Acconut commented Mar 22, 2014

Did you start couchdb yourself? Hoodie doesn't require you to do so since it starts couchdb automatically. Please stop couchdb and try again.

@srcspider
Copy link
Author

The default behavior on windows when you install couch is "Install as service" and "Start service automatically." Haven't done anything special other then following the basic install instructions they have.

@janl
Copy link
Contributor

janl commented Mar 23, 2014

Hoodie starts a separate CouchDB instance on a different port than the default installation, so they don't interfere with each other. The hoodie start output tells you the port that CouchDB was started with.

There is no need to stop the default installation, but it also won't be used by Hoodie :)

On 23.03.2014, at 00:14, srcspider [email protected] wrote:

The default behavior on windows when you install couch is "Install as service" and "Start service automatically."


Reply to this email directly or view it on GitHub.

@alittle
Copy link

alittle commented May 12, 2014

Builds have always been smooth on my mac but I'm bumping into the same CouchDB error in fs.js:427 trying to start and app on a Win 7 x64 machine at work similar to the one mentioned above (tried clearing hoodie and npm cache and installing from git rather than npm with the same result). The entire error on startup is the following:

Version: 0.4.10 (node v0.10.24, npm 1.3.21, platform: win32)

Initializing...
CouchDB started: http://127.0.0.1:6006
Error: spawn ENOENT
    at errnoException (child_process.js:980:11)
    at Process.ChildProcess._handle.onexit (child_process.js:771:34)

Stopping CouchDB...

fs.js:427
  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
                 ^
Error: ENOENT, no such file or directory 'C:\Code\Source\user\app2\data\couch.pid'

I can continue to play with this on a Mac but was hoping since this appears to build new hoodie apps successfully now to do basic development on windows as well if it's just a simple configuration/port tweak I'm missing (CouchDB is installed and running just fine on the default port 5984).

@boennemann
Copy link
Contributor

I'm not sure if this is still an issue for windows machines, but while digging through the cli code I saw there are manually concatenated paths (e.g. https://github.com/hoodiehq/hoodie-cli/blob/master/lib/hoodie/new.js#L246), maybe using path.join helps resolving this (or at least other windows related issues).

@svnlto
Copy link
Contributor

svnlto commented May 14, 2014

@boennemann I think using path.join could work here. Wanna create a PR for that?

@boennemann
Copy link
Contributor

Sure, I'll have a look this evening.

@Acconut
Copy link

Acconut commented May 14, 2014

To be honest I don't think that's the problem since node can handle paths containing both, front- and backslashes.
@alittle CouchDB needn't be started to run hoodie. It will find its binary and start an own instance to use.

@OClement
Copy link

Having the same issue here, everything freshly installed (on Win8)

According to the error output, we're missing couch.pid file in the data folder;

Would the Hoodie Scaffold be bad on Windows? I can confirm this file exist when I scaffold a new app on OSX

@alittle
Copy link

alittle commented May 16, 2014

Thanks for all of the quick responses already. I'll have to give these ideas another go when production work cools down next week ;-) I did make some progress that same day by entering the environment path variables per @zipzit 's comment near the bottom of this thread not sure if they will help you @OClement but might be worth a try.

@OClement
Copy link

Thanks for the response @alittle, unfortunately it doesn't seem to help my case

Been looking around a bit more and check what is happening here; If I understand correctly, the error we get (non-existing couch.pid) is not the root of the problem, and this file probably is created when the couch server instance gets actually created.

I think the problem is at least two-fold:
Some couchDB error happens (duh! - that's the first error), and the course of action in that case is to kill the related couch process. Normally, the couch.pid file should have been created, and the app tries to read that file, cannot because for some reason was not created in the first place, and Node throws the error we're seeing.

I'm not sure why it feels it needs to kill that process in the fist place; Seems like the stacktrace isn't long enough to lead us there.

Unfortunately I have limited experience when it comes to developping Node Apps, hopefully someone with more knowledge will be able to shed some light in here

@zipzit
Copy link

zipzit commented May 16, 2014

Ouch. I wish I could help you guys more.  I got busy on other stuff and hood.ie got sent to the back burner.  I've not looked at the code in months.  Apologies...  LB, Las Vegas Nevada USA.


From: OClement [email protected]
To: hoodiehq/my-first-hoodie [email protected]
Cc: zipzit [email protected]
Sent: Thursday, May 15, 2014 6:12 PM
Subject: Re: [my-first-hoodie] Windows Installation Fails (#49)

Thanks for the response @alittle
Been looking around a bit more and check what is happening here; If I understand correctly, the error we get (non-existing couch.pid) is not the root of the problem, and this file probably is created when the couch server instance gets actually created.
I think the problem is at least two-fold:
Some couchDB error happens (duh! - that's the first error), and the course of action in that case is to kill the related couch process. Normally, the couch.pid file should have been created, and the app tries to read that file, cannot because for some reason was not created in the first place, and Node throws the error we're seeing.
I'm not sure why it feels it needs to kill that process in the fist place; Seems like the stacktrace isn't long enough to lead us there.
Unfortunately I have limited experience when it comes to developping Node Apps, hopefully someone with more knowledge will be able to shed some light in here

Reply to this email directly or view it on GitHub.

@Acconut
Copy link

Acconut commented May 16, 2014

I tested it on my windows 7 machine and it worked like a charm.
I assume your environment variables may cause it.

These are mine:

  COUCH_BIN: 'D:\\Programme\\CouchDB\\bin\\couchdb.bat',
  COUCH_DEFAULT_INI: 'D:\\Programme\\CouchDB\\etc\\couchdb\\default.ini',

I've installed CouchDB to D:\\Programme\\CouchDB.

@Acconut
Copy link

Acconut commented May 17, 2014

I've tried it now on a blank windows 8 machine and ran into the same issue. I assume it's a problem with multicouch not finding the binary.

I'll investigate.

@Acconut
Copy link

Acconut commented May 17, 2014

I've found the issue: https://github.com/hoodiehq/node-multicouch/blob/master/lib/multicouch.js#L17
I'll assume you have a 64-bit machine and therefore process.arch isn't x86 and win_bin will be c:/program files/apache .... But Apache only offers x86-builds for windows. You can fix it manually doing something like:

win_bin = 'C:\\Program Files (x86)\\Apache Software Foundation\\CouchDB\\bin\\erl.exe';

Tell me whether it helps. I'll make a pull request soon.

@jamesmosier
Copy link

So is there a definite resolution to this? I have a x64 Windows 7 installation currently, but installed CouchDB as x86 so the erl.exe lives in this path C:\\Program Files (x86)\\Apache Software Foundation\\CouchDB\\bin\\erl.exe.

I've also tried to install hoodie-cli via npm install -g git://github.com/hoodiehq/hoodie-cli.git.

When I try running the hoodie new myfirstapp --verbose, the issue I am getting is:
Cloning into 'C:\Users\jamez\.hoodie\cache\my-first-hoodie' ... fatal: unable to access 'https://github.com/hoodiehq/my-first-hoodie.git/': Could not resolve proxy: %HTTP_PROXY% - Could not fetch project from https://github.com/hoodiehq/my-first-hoodie.git/

Of course I tried cleaning my NPM & hoodie cache with no luck :( Also I've had both NPM and Git installed and both have been working great for over a year.

@Acconut
Copy link

Acconut commented Jun 10, 2014

@Jamez14 The issue you're having is different from the one discussed here. You seem to have a problem with hoodie-cli but I'll have a look.

Do you use a proxy? Please try running git clone https://github.com/hoodiehq/my-first-hoodie.git 'C:\Users\jamez\.hoodie\cache\my-first-hoodie' --depth=1. If this succeds you can continue with hoodie new app.

@jamesmosier
Copy link

@Acconut thanks!

Also, I did one of the fixes from #85 in which I added the folder my-first-hoodie to the .hoodie/cache directory but then get stuck at the same spot as the poster did. I'll redirect my "thoughts" to that issue.

@Acconut
Copy link

Acconut commented Jun 10, 2014

@Jamez14 Did it work now?

@jamesmosier
Copy link

@Acconut unfortunately not completely. Here's what it looks like on my end...

hoodie_defect

@Acconut
Copy link

Acconut commented Jun 10, 2014

@Jamez14 I'm not sure what produces this error but in the meantime you can create a hoodie app by yourself using these commands: https://gist.github.com/Acconut/8f5853b62d9929de87db#file-new-bat

@jamesmosier
Copy link

@Acconut awesome, thanks for that!

@tomcon
Copy link

tomcon commented Dec 19, 2014

Windows Installation
If you don't accept the default installation folder then basically you're screwed - the installer should do much better. A slightly more detailed answer + correction of typos is:

After installing all the modules, head to the root of the website,
open .\node_modules\hoodie-server\node_modules\multicouch\lib\multicouch.js.

Edit line 17 and set this to wherever you have installed couchDB
win_bin = 'C:\Program Files (x86)\Apache Software Foundation\CouchDB\bin\erl.exe';

@janl
Copy link
Contributor

janl commented Dec 20, 2014

It is indeed a prerequisite of Hoodie to expect CouchDB to be installed in the default location. We should make that clear in the docs.

I filed hoodiehq-archive/node-multicouch#26 to help solve this in the underlying component. If anyone could help figure this out, we can support any install location. Any help would be very appreciated! <3

@janl janl reopened this Dec 20, 2014
@ghost
Copy link

ghost commented Oct 3, 2016

Hello! does this has a solution? getting the same error on my win10 x64 laptop

@gr2m
Copy link
Contributor

gr2m commented Oct 4, 2016

@websus this repository is outdated. Can you please try npm uninstall --global hoodie, and then try to setup our new starter app instead: https://github.com/hoodiehq/hoodie-app-tracker

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests