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 8 x64 install error #485

Closed
CnApTaK opened this issue Dec 17, 2013 · 13 comments · Fixed by #486
Closed

Windows 8 x64 install error #485

CnApTaK opened this issue Dec 17, 2013 · 13 comments · Fixed by #486

Comments

@CnApTaK
Copy link

CnApTaK commented Dec 17, 2013

d:\project>npm install pg
npm http GET https://registry.npmjs.org/pg
npm http 304 https://registry.npmjs.org/pg
npm http GET https://registry.npmjs.org/generic-pool/2.0.3
npm http GET https://registry.npmjs.org/buffer-writer/1.0.0
npm http GET https://registry.npmjs.org/nan
npm http 304 https://registry.npmjs.org/generic-pool/2.0.3
npm http 304 https://registry.npmjs.org/buffer-writer/1.0.0
npm http 304 https://registry.npmjs.org/nan

[email protected] install d:\project\node_modules\pg
node-gyp rebuild || (exit 0)

d:\project\node_modules\pg>node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin....\node_modules\node-gyp\bin\node-gyp.js" rebuild
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
binding.cc
..\src\binding.cc(3): fatal error C1083: Cannot open include file: 'nan.h': No such file or directory [d:\project\node_modules\pg\build\binding.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: msbuild 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:267:23)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:789:12)
gyp ERR! System Windows_NT 6.2.9200
gyp ERR! command "node" "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd d:\project\node_modules\pg
gyp ERR! node -v v0.10.23
gyp ERR! node-gyp -v v0.12.1
gyp ERR! not ok
[email protected] node_modules\pg
├── [email protected]
├── [email protected]
└── [email protected]

d:\project>_

@davepile
Copy link

Came upon this yesterday too. There is a discussion here xmppo/node-expat#78 so possibly this is a node-gyp issue. I am new to npm so not smart enough to figure out what to do though

@brianc
Copy link
Owner

brianc commented Dec 18, 2013

I'm not sure about node-gyp on windows. I really am no good at offering much support on the windows side of things...if anyone's interested in contribution on that front just lemme know & I'll open the repo up to you.

In the mean time, do npm install pg.js to avoid the compilation all together. All the postgres you know and love without any of the node-gyp headache.

@CnApTaK
Copy link
Author

CnApTaK commented Dec 18, 2013

Thanks! pg.js works well. Compilation also successfully executed after specifying the absolute path to the file nan.h.

@CnApTaK CnApTaK closed this as completed Dec 18, 2013
@davepile
Copy link

Thanks for the reply Brian.
Installing pg.js did not work for me, I was trying out sequelize and this did not work with pg.js. However I was able specify an absolute path to nan.h in src/binding.cc and re run node-gyp to rebuild and get it all working

I had a bit of a look in the pg project and adding 'node_modules/nan' in the include_dirs array in binding.gyp also did the trick. Perhaps this could be added to the project. It looks to me that the line node -e 'require("nan")' isnt doing anything. When I run this from the command line there is no output.

  'include_dirs': [
    '<!@(pg_config --includedir)',
    '<!(node -e \'require("nan")\')',
    'node_modules/nan'
  ],

@brianc
Copy link
Owner

brianc commented Dec 18, 2013

That's strange. node -e 'require("nan")' definitely outputs something on mac. I wonder if its an issue with nan not outputting the include path on windows? /cc @rvagg

@paco3346
Copy link

I'm not so sure this PR fixed everything. I'm still having trouble getting this to compile.

@rvagg
Copy link
Contributor

rvagg commented Dec 20, 2013

@paco3346 can we see stout of your current compile?

@paco3346
Copy link

This is a clean install of latest x86 node.

npm WARN package.json [email protected] No repository field.
npm http GET https://registry.npmjs.org/pg
npm http 304 https://registry.npmjs.org/pg
npm http GET https://registry.npmjs.org/generic-pool/2.0.3
npm http GET https://registry.npmjs.org/buffer-writer/1.0.0
npm http GET https://registry.npmjs.org/nan
npm http 304 https://registry.npmjs.org/buffer-writer/1.0.0
npm http 304 https://registry.npmjs.org/generic-pool/2.0.3
npm http 304 https://registry.npmjs.org/nan

> [email protected] install c:\map\nodejs\node_modules\pg
> node-gyp rebuild || (exit 0)


c:\map\nodejs\node_modules\pg>node "C:\Program Files (x86)\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild
  binding.cc
..\src\binding.cc(3): fatal error C1083: Cannot open include file: 'nan.h': No such file or directory [c:\map\nodejs\node_modules\pg\build\binding.vcxproj]
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 (x86)\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:267:23)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:789:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "node" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd c:\map\nodejs\node_modules\pg
gyp ERR! node -v v0.10.24
gyp ERR! node-gyp -v v0.12.1
gyp ERR! not ok
[email protected] node_modules\pg
├── [email protected]
├── [email protected]
└── [email protected]

@rvagg
Copy link
Contributor

rvagg commented Dec 20, 2013

looks like we still need a publish by @brianc, that version you have has this in binding.gyp:

'<!(node -e \'require("nan")\')'

but this is in master:

'<!(node -e "require(\'nan\')")'

@paco3346
Copy link

Ah, I wondered if that was the case. I've used node for a lot of things but never published anything so I'm not too familiar with the publishing procedures.
Based on the fact this was only merged in yesterday I was suspicious if I wasn't actually getting the latest copy of master.

Anyway, thank you for your help sir! I'll check back on this in a day or two.

@brianc
Copy link
Owner

brianc commented Dec 20, 2013

Publishing tonight! sorry for the delay

@brianc
Copy link
Owner

brianc commented Dec 20, 2013

@paco3346 if you want to see if something is published...this is how I do it

$ npm show pg

This returns all the published versions of node-postgres (or any package) and the date they were published. You can compare those dates to the dates of the commits and kinda get a feeling for how things are looking compared to the github repo.

Another way is to check the "tags" on github. Everything at the tag and before is published at that version. If there are commits after the latest tag they're likely not published in a version to npm. NPM makes this amazingly easy in that when you're working on a module you can do something like this in the module's root directory:

$ npm version [major | minor | patch] -m "Bump version"

And npm will go and bump the major/minor/patch version in your package.json file, commit the change, and create a tag in git all at once. Pretty handy.

SO really you can do it all in one line:

$ npm version minor -m "Bump version" && git push origin master --tags && npm publish

@paco3346
Copy link

Ooh, fancy. Thanks for the pointer!

And it looks like everything is building properly now. Thanks again!

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

Successfully merging a pull request may close this issue.

5 participants