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

Can't install on Windows #31

Closed
x10ba opened this issue Feb 25, 2015 · 17 comments
Closed

Can't install on Windows #31

x10ba opened this issue Feb 25, 2015 · 17 comments

Comments

@x10ba
Copy link

x10ba commented Feb 25, 2015

Hi,
Here is my env:
OS: Windows 7 Enterprise
Node Version: v0.10.36
node-gyp Version: v1.0.1

I am pretty new to windows, but after using node, mongodb, rethinkdb, npm for several years, this is the first module that has given me problems-- I've already used up 10 hours in trying to get it to work :(

Here is the info, any suggestions helps.

I get these errors:

  • C4530: C++ exception error ...
  • fatal error C1083: Cannot open include file: 'oci.h'
  • fatal error C1083: Cannot open include file: 'oratypes.h'
  • Error: ...\bin\msbuild.exe failed with exit code: 1 at Child Process

Failed at oracledb@0.3.1 install script

It fails on node-gyp rebuild

@cjbj
Copy link
Member

cjbj commented Feb 25, 2015

Where did you install Oracle Instant Client?
How and where did you set OCI_LIB_DIR and OCI_INC_DIR?
What C compiler are you using?

@cjbj cjbj added the question label Feb 25, 2015
@x10ba
Copy link
Author

x10ba commented Feb 25, 2015

Hi,

I installed instant client: c:\oracle\instantclient
I did not set the OCI since the documentation said not to if I didn't relocate the instant client-- perhaps this is the issue?
I used both MVS 2012 and MVS 2010 Express

Thanks for being so prompt-- I am excited to get this up and running

@cjbj
Copy link
Member

cjbj commented Feb 25, 2015

And where did you unzip the SDK to - what's the actual path of your oci.h file? The error is about the SDK files.

@x10ba
Copy link
Author

x10ba commented Feb 25, 2015

Hi,
One Error resolved:

I deleted and reinstalled the Instant Client-- it resolved the errors for oci.h and oratypes.h (noting that path = c:/oracle/instantclient, which is default)

New Errors:
unresolved external symbol: [_OCIHandleFree, _OCIEnvCreate, _OCIAtrrSet, _OCITransRollback, _OCISessionGet, _COIBreak, _OCIHandleAlloc, _OCIAttrGet, _OCITransCommit, _OCISessionRelease, ...]

@cjbj
Copy link
Member

cjbj commented Feb 25, 2015

When are you getting the errors? When building or running?

The current instructions aren't clear that you need to set PATH in the system settings. There is a comment in #7 (comment) with a link that might help. (Note you don't need to keep OCI_INC_DIR and OCI_LIB_DIR set after installation completes, so setting these in the cmd shell should be fine)

@x10ba
Copy link
Author

x10ba commented Feb 25, 2015

Errors are on the build.
One last error: fatal error LNK1181: cannot open input file C:\oracle\instantclient\sdk\lib\msvc.obj

  • OCI LIbraries need to be set globally and shell restarted: resolved _OCI errors

@cjbj
Copy link
Member

cjbj commented Feb 26, 2015

Just sounds like PATH is not set. Hard for me to tell offhand, since I don't personally use Windows. If you list one complete scenario that you tried, including the compiler version, how it was installed, where you got Instant Client from and how you extracted it, how & where you set any variables. Basically list all the things we'd see if we looked over your shoulder.

@mradamlacey
Copy link

I got this working successfully after much gnashing of teeth.

My environment:

  • WIndows 7 x64
  • Visual Studio 2013 compiler (vc12)
  • NodeJS x64 v0.10.35
  • Python 2.7

Here's my important notes:

  • Follow instructions from README.md, take care of the following:
    • Make sure the NodeJS architecture (x86 vs x64) matches the architecture of the Oracle client installation
    • Do NOT set the PYTHON environment variable (or if you do make sure it works) - if this env var is not pointing at a Python executable then node-gyp is going to fail with process spawn ENEONT errors
  • Use NodeJS v0.10.35 - haven't tested on another version
  • Find ~./node-gyp/0.10.35/common.gypi - for me this was in: %USERPROFILE%\.node-gyp\0.10.35 (this could be different depending on how you installed node, and if you chose a different node version)
    • Make the following changes below to add msbuild_toolset line to the below Debug section AND to the Release section.
'Debug': {
  'defines': [ 'DEBUG', '_DEBUG' ],
  'cflags': [ '-g', '-O0' ],
  'conditions': [
    ['target_arch=="x64"', {
      'msvs_configuration_platform': 'x64',
      'msbuild_toolset': 'v120_xp'             // added to target VS 2013 compiler
    }],
  ],

Without this change to common.gypi it looks like node-gyp was only targeting the VS2010 compiler (I have both installed on my machine), and I got the following error:

C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.Cpp.Platform.targets(64,5): error MSB8020: The build tools for Visual Studio 2010 (Platform Toolset = 'v100') cannot be found. To build using the v100 build tools, please install Visual Studio 2010 build tools.  Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Upgrade Solution...". [C:\tools\node-oracledb\build\oracledb.vcxproj]

I hope this helps someone...

@pvenkatraman
Copy link

Have you tried running vcvars64.bat from your VC/bin/ directory. This maps to the correct environment and so the above mentioned additional entries are not required.

@clystian
Copy link

@x10ba
Hey dude, its done
I was traying install and compile, searching dependencies, node-gyn failed
and i found this instructions
https://github.com/oracle/node-oracledb/blob/master/INSTALL.md#instwin

I can resume that, you need install instanclient basi and sdk (this include oci.h and oratypes.h)
@cjbj said before its about sdk

@rogah
Copy link

rogah commented Mar 27, 2015

Not able to install it either:

Environment:

  • WIndows 7 x64
  • Visual Studio 2013 compiler (vc12)
  • NodeJS x64 v0.12.0
  • Python 2.7

Environment variables:

  • OCI_LIB_DIR = C:\oracle\instantclient
  • OCI_INC_DIR = C:\oracle\instantclient

Basic and SDK folder:

  • C:\oracle\instantclient

Error:

c:\tools\node-oracledb>npm i -g

oracledb@0.4.1 install C:\tools\nodist\bin\node_modules\oracledb
node-gyp rebuild

C:\tools\nodist\bin\node_modules\oracledb>if not defined npm_config_node_gyp (node "C:\tools\nodist\bin\node_modules\npm\bin\node-gyp-bin....\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (rebuild)
Building the projects in this solution one at a time. To enable parallel build,
please add the "/m" switch.
njsOracle.cpp
njsPool.cpp
njsConnection.cpp
njsMessages.cpp
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\iosfwd(11): fata
l error C1083: Cannot open include file: 'crtdbg.h': No such file or directory
(..\src\njs\src\njsMessages.cpp) [C:\tools\nodist\bin\node_modules\oracledb\bui
ld\oracledb.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\iosfwd(11): fata
l error C1083: Cannot open include file: 'crtdbg.h': No such file or directory
(..\src\njs\src\njsPool.cpp) [C:\tools\nodist\bin\node_modules\oracledb\build\o
racledb.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\iosfwd(11): fata
l error C1083: Cannot open include file: 'crtdbg.h': No such file or directory
(..\src\njs\src\njsOracle.cpp) [C:\tools\nodist\bin\node_modules\oracledb\build
\oracledb.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\iosfwd(11): fata
l error C1083: Cannot open include file: 'crtdbg.h': No such file or directory
(..\src\njs\src\njsConnection.cpp) [C:\tools\nodist\bin\node_modules\oracledb\b
uild\oracledb.vcxproj]
dpiEnv.cpp
dpiEnvImpl.cpp
dpiException.cpp
dpiExceptionImpl.cpp
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\iosfwd(11): fata
l error C1083: Cannot open include file: 'crtdbg.h': No such file or directory
(..\src\dpi\src\dpiEnvImpl.cpp) [C:\tools\nodist\bin\node_modules\oracledb\buil
d\oracledb.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\iosfwd(11): fata
l error C1083: Cannot open include file: 'crtdbg.h': No such file or directory
(..\src\dpi\src\dpiEnv.cpp) [C:\tools\nodist\bin\node_modules\oracledb\build\or
acledb.vcxproj]
dpiConnImpl.cpp
dpiDateTimeArrayImpl.cpp
dpiPoolImpl.cpp
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\iosfwd(11): fata
l error C1083: Cannot open include file: 'crtdbg.h': No such file or directory
(..\src\dpi\src\dpiExceptionImpl.cpp) [C:\tools\nodist\bin\node_modules\oracled
b\build\oracledb.vcxproj]
dpiStmtImpl.cpp
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\iosfwd(11): fata
l error C1083: Cannot open include file: 'crtdbg.h': No such file or directory
(..\src\dpi\src\dpiPoolImpl.cpp) [C:\tools\nodist\bin\node_modules\oracledb\bui
ld\oracledb.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\iosfwd(11): fata
l error C1083: Cannot open include file: 'crtdbg.h': No such file or directory
(..\src\dpi\src\dpiConnImpl.cpp) [C:\tools\nodist\bin\node_modules\oracledb\bui
ld\oracledb.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\iosfwd(11): fata
l error C1083: Cannot open include file: 'crtdbg.h': No such file or directory
(..\src\dpi\src\dpiDateTimeArrayImpl.cpp) [C:\tools\nodist\bin\node_modules\ora
cledb\build\oracledb.vcxproj]
dpiUtils.cpp
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\iosfwd(11): fata
l error C1083: Cannot open include file: 'crtdbg.h': No such file or directory
(..\src\dpi\src\dpiStmtImpl.cpp) [C:\tools\nodist\bin\node_modules\oracledb\bui
ld\oracledb.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\iosfwd(11): fata
l error C1083: Cannot open include file: 'crtdbg.h': No such file or directory
(..\src\dpi\src\dpiUtils.cpp) [C:\tools\nodist\bin\node_modules\oracledb\build
oracledb.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: C:\Program Files (x86)\MSBuild\12.0\bin\msbuild.exe failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\tools\nodist\bin\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:1067:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\tools\nodist/v-x64/0.12.0/node.exe" "C:\tools\nodist\bin\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd C:\tools\nodist\bin\node_modules\oracledb
gyp ERR! node -v v0.12.0
gyp ERR! node-gyp -v v1.0.3
gyp ERR! not ok
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\tools\nodist/v-x64/0.12.0/node.exe" "C:\tools\nodist\bin\node_modules\npm\bin\npm-cli.js" "i" "-g"
npm ERR! node v0.12.0
npm ERR! npm v2.7.3
npm ERR! code ELIFECYCLE

npm ERR! oracledb@0.4.1 install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the oracledb@0.4.1 install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the oracledb 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 oracledb
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! c:\tools\node-oracledb\npm-debug.log

@cjbj
Copy link
Member

cjbj commented Mar 27, 2015

@rogah I wonder if your environment is set in the command shell you are using? Did you run vcvars64.bat? In any case, you will need Node 0.10; see #2

@Bigous
Copy link
Contributor

Bigous commented Mar 27, 2015

@rogah If you need to use node 0.12 or iojs, you can try with the pull request #43 - Build with NaN.
Or wait a little bit. @cjbj is working on merging it already.

@rogah
Copy link

rogah commented Mar 27, 2015

This is awesome news @Bigous! I tried even with the node 0.10 and I still got the same issue. Hopefully I'll be able to get around with this new pull request you guys are working on.

@cjbj I ran the vcvars64.bat with node 0.10 and I got the same thing. I just can't figure out what is wrong with my environment.

@cjbj
Copy link
Member

cjbj commented Mar 27, 2015

@rogah Check OCI_LIB_DIR and OCI_INC_DIR. You stated you had

OCI_LIB_DIR = C:\oracle\instantclient
OCI_INC_DIR = C:\oracle\instantclient

The instructions https://github.com/oracle/node-oracledb/blob/master/INSTALL.md#instwin say:

If you have Instant Client in a location that is not C:\oracle\instantclient, then tell the installer where to find the Oracle libraries and headers:

set OCI_LIB_DIR=D:\instantclient_12_1\sdk\lib\msvc
set OCI_INC_DIR=D:\instantclient_12_1\sdk\include

So try either unsetting the vars, or appending the appropriate subdirectories.

(Maybe I should change the instructions and not mention the default location, forcing everyone to set the variables?)

@rogah
Copy link

rogah commented Mar 28, 2015

I just copy and paste by mistake the same value here. This is how my env variables are actually setup.

OCI_LIB_DIR = C:\oracle\instantclient\sdk\lib\msvc
OCI_INC_DIR = C:\oracle\instantclient\sdk\include

I even have this other one as well:

OCI_INCLUDE_DIR = C:\oracle\instantclient\sdk\include

I'm going try to clenup my VS environment and redo it again. I have other versions of VC installed.

@cjbj
Copy link
Member

cjbj commented Mar 29, 2015

I'm closing this issue. The original poster of this issue has been silent for a month. The thread is spreading. I've made some tweaks to the Windows install doc that may help some people.

Everyone: Please open new threads for new issues

@cjbj cjbj closed this as completed Mar 29, 2015
@oracle oracle locked and limited conversation to collaborators Aug 13, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants