Node.js SDK Installation on Windows

Hello,

I am attempting to install the Node.js SDK for Couchbase on a Windows 7 machine. I get several errors when I run “npm install --save couchbase” from a command prompt. I am running Node.js 6.2.0 through NVM for Windows. With which versions of Node.js is the couchbase package compatible?

We build and test against 0.10.42, 0.12.10, 4.3.0, 5.6.0 currently from what I see and I know @brett19 was working with the team on some updates there.

I think we’d expect that to be compatible. Can you pass the module logs along? Or file an issue?

@ingenthr Thank you for replying to my question. I would happy to help resolve this issue. Let’s figure out how to move forward. When you mentioned the module logs, are you referring to the npm-debug.log file? If so, what is the best way to send it (and do so in a way that will not reveal any secure information about my computer or work environment)? It seems I am unable to log into the Couchbase JIRA repository with my Couchbase Forums credentials.

@ingenthr FYI, I am using NVM to install couchbase (npm install couchbase) against different versions of Node and am getting mixed results.

Works Well
0.10.40
0.10.45
0.12.14

Generates Multiple Compilation Errors
4.0.0
4.3.0
4.4.5
5.6.0
6.2.0

I should also mention that I am using MS Visual Studio Express 2012 as my C/C++ compiler. Do you test the compilation steps against any particular versions of Visual Studio?

@brett19 Referencing Problem Node.js couchbase sdk, does the installation still generate a builderror.log? If so, what should be the path to its location on a Windows machine. I do not see the file on my computer.

I have been able to get the Node.js SDK to install on my machine over Node.js 6.0.0. I am sharing the informatin below, in case anyone else is experiencing the same issue. These steps seem to have resolved the problem for me.

  1. Uninstalled Visual Studio 2012 or Visual Studio 2015
  2. Restarted my computer
  3. Installed all of the components (not just the defaults) for Visual Studio 2013 Community Edition (https://www.visualstudio.com/en-us/downloads/download-visual-studio-vs.aspx)
  4. Restarted my computer
  5. Opened a command prompt and made sure NVM was using Node.js 6.0.0 (e.g. nvm use 6.0.0 or nvm install 6.0.0)
  6. From a command prompt, globally installed node-gyp (npm install –g node-gyp) (Reference: https://github.com/nodejs/node-gyp)
  7. From a command prompt, ran npm config set msvs_version=2013
  8. From a command prompt, ran npm config get msvs_version to confirm that I got 2013 by setting the value in the previous step
  9. From a command prompt, ran npm config set python <path_to_the_python_executable> e.g. npm config set c:\Python27\python.exe
  10. Ran npm config get python to confirm that I got the value I typed in the previous step
  11. From a command prompt, ran npm install couchbase

As of Node.js v4.0.0, VS2015+ is required to compile Node.js, and thus the same requirement exists for all native libraries as well. You can refer to the node-gyp README for more information on the prerequisite requirements for building native Node.js libraries here: https://github.com/nodejs/node-gyp.

Cheers, Brett

Steps to install couchbase node module:

  1. Install Visual Studio 2013
  2. Install Python2.7.X
  3. Install Node
  4. Install Node Version Manager(nvm) from https://github.com/coreybutler/nvm-windows/releases/download/1.1.4/nvm-setup.zip (Select C:\Program Files as destination directory while installation).
  5. Open Windows powershell (Run as administrator) and go to the project folder
  6. Run: npm install -g node-gyp
  7. Run: npm install --global --production windows-build-tools
  8. Run: npm config set python c:\Python27\python.exe
  9. Run: npm config set msvs_version=2013
  10. Get Node version by running ‘node -v’, this will give node version like -6.10.3
  11. Run: nvm use 6.10.3 (or the verison of node which you have installed).
  12. Run: npm install couchbase --save