To learn how to manage multiple versions of IBM SDK Node.js on Windows 7, click here

Overview
This is a simple recipe to setup a IBM SDK Node.js 4.5 environment on windows 7
and install apiconnect globally.

Make sure you have all the pre-requisite as documented in IBM Knowledge center.

install IBM SDK Node.js version 4.5

To install a new version of node.js, download from IBM SDK Node.js Download URL

Note: we should use the 64 bit binary.

screen-shot-2016-09-26-at-10-24-22-pm

From the installer, choose the following options:

    1. Start a command line prompt and execute installer
    2. Select install a new instance


node-install-1

    1. Select a new installation location at C:\Users\Administrator\IBM\node45


node-install-node45location

    1. Specify ShortCut to new Program Group


node-install-shortcut

    1. Press Next and review install summary and then install


node-install-node-summary

    1. Install is done with the success completion


node-iinstall-success

Choosing the IBM SDK Node.js Command Prompt

    1. Start Menu->All Programs
    2. Choose IBM SDK for Node.js (TM) 4.5.0.0 Program Group


screen-shot-2016-09-26-at-10-25-02-pm

    1. Expand the Program Group


screen-shot-2016-09-27-at-12-57-17-am

    1. Select the Node.js Command Prompt
    2. Echo %PATH%

You will find that the location of Node version and NPM Prefix is setup in the path


screen-shot-2016-09-23-at-11-45-37-pm

Installing latest npm version (optional)
From the IBM SDK Node.js command prompt, run node -v and npm -v
to confirm your version.
You will find that the default npm version is version 2.15.9. This is the official supported version from IBM
SDK Node.js runtime.

screen-shot-2016-09-26-at-10-27-40-pm

You can update to the latest npm version 3 ( 3.10.8) to resolve windows system path length limitation as suggested by npm.
npm 3 flattens the dependencies tree structures.
However, in the community, there are reports that npm 3 is slower and
there are other racing issues with npm 3.

npm install -g npm
invoke npm -v to verify you got 3.10.8

screen-shot-2016-09-27-at-12-57-49-am

Verifying Node.js environment
Before we start any serious work, we should always verify the Node.js environment by some simple test.
npm install -g mocha
mocha --version or moch --help

screen-shot-2016-09-26-at-10-59-58-pm

If this works, you can proceed to install apiconnect.
If mocha show command not found, go to the Tips below.

Installing apiconnect globally

There are two ways to install apiconnect.

  1. From npmjs.org
    npm install -g apiconnect –no-optional –ignore-scripts
  2. apiconnect bundle
  3. npm install -g apiconnect-2.3.4.tgz –no-optional –ignore-script

Note: –ignore-scripts is a temporary workaround for version 5.0.4.0
The options should not be required in future release.
After the installation completes, you should be able to execute the following:

apic -v

    apic –ext-version


screen-shot-2016-09-26-at-11-43-56-pm

Tips:
When run into unexpected errors during install, try the following:

  • If installation shows success but command is not found.
    1. echo %PATH% to check your environment
    2. Ensure your npm prefix is in your PATH. To get npm prefix, invoke npm config get prefix.
    3. The default npm prefix is C:\Users\Adminstrator\AppData\Roaming\npm
  • If EPERMs issues or others install issues
    1. Check the npm-debug.log for further information
    2. npm cache clear
    3. Manually remove the npm-cache folder
    4. Close all other windows command prompt and try again
    5. Try to isolate your issues with back to basic environment.

Summary
IBM SDK for Node.js is the official supported version from IBM.
If you invoke the Node.js command prompt, the default location of Node and NPM Prefex will be setup in the PATH.
Try not to mix open source Node.js and IBM SDK Node.js in your environment and keep it simple.

12 comments on"Installing API Connect on Windows 7 with IBM SDK Node.js"

  1. what does –no-optional and –ignore-scripts does?

    • –no-optiional is to skip installing any optional dependencies. If you do not have compiler setup or compile env not properly setup , installing optional dependencies may results in some warnings or errors that may look alarming, but in fact, those are optional dependencies and can be ignored .

    • –ignore-scripts is a temporary workaround to ignore any pre-install, post-install scripts for version 5040. If you are installing from npmjs.org, the issue should be fixed and you no longer require the workaround.

      • Hi ivyho, thank you for the step-by-step guide on installing apic! I installed from npmjs.org without the option –ignore-scripts. But, it still failed. Rerunning it with –ignore-scripts and it was installed successfully. It’s still version 5040 (without the fix you mentioned?) The output from apci -v is “API Connect: v5.0.4.0 (apiconnect: v2.3.6)”. I noted that even the command apic -v or apic –ext-version took quite some time to come back.

        • It turns out that the fix is not yet in npmjs.org then, that is why you still need that option.
          Yes, apic -v and apic –ext-version take some time to return.
          The team is working on making installation faster and better performance
          Please try it out apic commands and we are more than happy to get user feedback.
          Thanks

  2. Hi ivyho,
    I was wondering if any release notes are shared for the new apic versions? It would be nice know what has changed when updating.

    Thanks!

  3. hi ivhyo
    i have some error when installing apiconnect
    C:\Users\ztlnb>npm install -g apiconnect -no-optional -ignore-scripts
    npm ERR! addLocal Could not install C:\Users\ztlnb\-no-optional
    npm ERR! addLocal Could not install C:\Users\ztlnb\-ignore-scripts
    npm ERR! Windows_NT 6.1.7601
    npm ERR! argv “C:\\IBM\\node\\node.exe” “C:\\Users\\ztlnb\\AppData\\Roaming\\npm
    \\node_modules\\npm\\bin\\npm-cli.js” “install” “-g” “apiconnect” “-no-optional”
    “-ignore-scripts”
    npm ERR! node v4.6.2
    npm ERR! npm v3.10.10
    npm ERR! path C:\Users\ztlnb\-no-optional
    npm ERR! code ENOENT
    npm ERR! errno -4058
    npm ERR! syscall open

    npm ERR! enoent ENOENT: no such file or directory, open ‘C:\Users\ztlnb\-no-opti
    onal’
    npm ERR! enoent ENOENT: no such file or directory, open ‘C:\Users\ztlnb\-no-opti
    onal’
    npm ERR! enoent This is most likely not a problem with npm itself
    npm ERR! enoent and is related to npm not being able to find a file.
    npm ERR! enoent

    npm ERR! Please include the following file with any support request:
    npm ERR! C:\Users\ztlnb\npm-debug.log

    C:\Users\ztlnb>node -v
    v4.6.2

    C:\Users\ztlnb>npm -v
    3.10.10

    C:\Users\ztlnb>mocha –version
    3.2.0

    • Hi
      probably difficult to see from the doc, sorry about that.
      The options are “dash dash” –no-optional
      However, you should try without the options now.
      It should just work with the latest apiconnect which is latest 5050.
      Only if you have issues, try the –no-optional.

Join The Discussion

Your email address will not be published. Required fields are marked *