question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. Itย collects links to all the places you might be looking at while hunting down a tough bug.

And, if youโ€™re still stuck at the end, weโ€™re happy to hop on a call to see how we can help out.

permissions prevent `npm rebuild`

See original GitHub issue

Iโ€™ve reproduced this in a git checkout, and by installing from npm.

In github, just checkout master, npm install, and npm rebuild, the rebuild fails with:

> ibm_db@2.0.0 install /private/tmp/node_modules/ibm_db
> node installer/driverInstall.js

Downloading DB2 ODBC CLI Driver from https://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/macos64_odbc_cli.tar.gz...

100.00% | 20080158 bytes downloaded out of 20080158 bytes.{ Error: EACCES: permission denied, open '/private/tmp/node_modules/ibm_db/installer/clidriver/msg/en_US.iso88591/db2adm.mo'
  errno: -13,
  code: 'EACCES',
  syscall: 'open',
  path: '/private/tmp/node_modules/ibm_db/installer/clidriver/msg/en_US.iso88591/db2adm.mo' }

npm ERR! Darwin 16.6.0
npm ERR! argv "/Users/sam/.nvm/versions/node/v7.9.0/bin/node" "/Users/sam/.nvm/versions/node/v7.9.0/bin/npm" "rebuild"
npm ERR! node v7.9.0
npm ERR! npm  v4.2.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ibm_db@2.0.0 install: `node installer/driverInstall.js`
npm ERR! Exit status 1

I believe it is because all the .mo files are read-only:

/tmp % ls -l /Users/sam/w/ibm/node-ibm_db/installer/clidriver/msg/en_US.iso88591
total 9296
drwxr-xr-x  19 sam  staff      646 23 Feb 03:42 ./
drwxr-xr-x   3 sam  staff      102 23 Feb 03:56 ../
-r--r--r--   1 sam  staff   107882 23 Feb 03:42 db2adm.mo
-r--r--r--   1 sam  staff   255496 23 Feb 03:42 db2admh.mo
-r--r--r--   1 sam  staff     5390 23 Feb 03:42 db2caem.mo
....

That might be a problem in the zip or tar file they were extracted from.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:28 (13 by maintainers)

github_iconTop GitHub Comments

2reactions
sam-githubcommented, Jun 15, 2017

Worked for me!

1reaction
sam-githubcommented, Jun 15, 2017

@rhtpandeyIN You have tried what I am doing and canโ€™t reproduce what I am sseeing? Following is complete reproduction example, the only thing it is missing is the initial git clone, but you can see the remote that I cloned:


ibm/dashdb-nodejs-helloworld (master u=) % git remotes
origin  git@github.com:sam-github/dashdb-nodejs-helloworld.git (fetch)
origin  git@github.com:sam-github/dashdb-nodejs-helloworld.git (push)
upstream        git@github.com:IBM-Bluemix/dashdb-nodejs-helloworld.git (fetch)
upstream        git@github.com:IBM-Bluemix/dashdb-nodejs-helloworld.git (push)
ibm/dashdb-nodejs-helloworld (master u=) % git clean -x -d
ibm/dashdb-nodejs-helloworld (master u=) % npm i --save git+https://git@github.com/rhtpandeyIN/node-ibm_db.git

> ibm_db@2.0.0 install /home/sam/w/ibm/dashdb-nodejs-helloworld/node_modules/ibm_db
> node installer/driverInstall.js

Downloading DB2 ODBC CLI Driver from https://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/linuxx64_odbc_cli.tar.gz...

100.00% | 18703240 bytes downloaded out of 18703240 bytes.

****************************************
You are downloading a package which includes the Node.js module for IBM DB2/Informix.  The module is licensed under the Apache License 2.0. The package also includes IBM ODBC and CLI Driver from IBM, which is automatically downloaded as the node module is installed on your system/device. The license agreement to the IBM ODBC and CLI Driver is available in /home/sam/w/ibm/dashdb-nodejs-helloworld/node_modules/ibm_db/installer   Check for additional dependencies, which may come with their own license agreement(s). Your use of the components of the package and dependencies constitutes your acceptance of their respective license agreements. If you do not accept the terms of any license agreement(s), then delete the relevant component(s) from your device.
****************************************

Downloading and extraction of DB2 ODBC CLI Driver completed successfully ...

make: Entering directory '/home/sam/w/ibm/dashdb-nodejs-helloworld/node_modules/ibm_db/build'
  CXX(target) Release/obj.target/odbc_bindings/src/odbc.o
  CXX(target) Release/obj.target/odbc_bindings/src/odbc_connection.o
  CXX(target) Release/obj.target/odbc_bindings/src/odbc_statement.o
  CXX(target) Release/obj.target/odbc_bindings/src/odbc_result.o
  SOLINK_MODULE(target) Release/obj.target/odbc_bindings.node
  COPY Release/odbc_bindings.node
make: Leaving directory '/home/sam/w/ibm/dashdb-nodejs-helloworld/node_modules/ibm_db/build'

npm WARN dashdbnodesample@0.0.1 No license field.

added 102 packages in 13.463s
ibm/dashdb-nodejs-helloworld (master *% u=) % ls node_modules/ibm_db/installer/clidriver
./   bin/  cfg/       conv/     db2profile*  lib/      msg/
../  bnd/  cfgcache/  db2dump/  include/     license/
ibm/dashdb-nodejs-helloworld (master *% u=) % ls node_modules/ibm_db/installer/clidriver/include
./   sqlca.h    sqlcli.h  sqlenv.h  sql.h       sqlsystm.h
../  sqlcli1.h  sqlda.h   sqlext.h  sqlstate.h
ibm/dashdb-nodejs-helloworld (master *% u=) % npm rebuild

> ibm_db@2.0.0 install /home/sam/w/ibm/dashdb-nodejs-helloworld/node_modules/ibm_db
> node installer/driverInstall.js

Rebuild Process: Found clidriver at -> /home/sam/w/ibm/dashdb-nodejs-helloworld/node_modules/ibm_db/installer/clidriver

Downloading of clidriver skipped - build is in progress...

make: Entering directory '/home/sam/w/ibm/dashdb-nodejs-helloworld/node_modules/ibm_db/build'
  CXX(target) Release/obj.target/odbc_bindings/src/odbc.o
odbc_bindings.target.mk:104: recipe for target 'Release/obj.target/odbc_bindings/src/odbc.o' failed
make: Leaving directory '/home/sam/w/ibm/dashdb-nodejs-helloworld/node_modules/ibm_db/build'

{ Error: Command failed: node-gyp configure build --IBM_DB_HOME="$IBM_DB_HOME" --IS_DOWNLOADED=false
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
In file included from ../src/odbc.cpp:25:0:
../src/odbc.h:27:21: fatal error: sqlcli1.h: No such file or directory
 #include <sqlcli1.h>
                     ^
compilation terminated.
make: *** [Release/obj.target/odbc_bindings/src/odbc.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/home/sam/.nvm/versions/node/v8.0.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:285:23)
gyp ERR! stack     at emitTwo (events.js:125:13)
gyp ERR! stack     at ChildProcess.emit (events.js:213:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:197:12)
gyp ERR! System Linux 4.8.0-54-generic
gyp ERR! command "/home/sam/.nvm/versions/node/v8.0.0/bin/node" "/home/sam/.nvm/versions/node/v8.0.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "build" "--IBM_DB_HOME=" "--IS_DOWNLOADED=false"
gyp ERR! cwd /home/sam/w/ibm/dashdb-nodejs-helloworld/node_modules/ibm_db
gyp ERR! node -v v8.0.0
gyp ERR! node-gyp -v v3.6.1
gyp ERR! not ok

    at ChildProcess.exithandler (child_process.js:252:12)
    at emitTwo (events.js:125:13)
    at ChildProcess.emit (events.js:213:7)
    at maybeClose (internal/child_process.js:887:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:208:5)
  killed: false,
  code: 1,
  signal: null,
  cmd: 'node-gyp configure build --IBM_DB_HOME="$IBM_DB_HOME" --IS_DOWNLOADED=false' }
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ibm_db@2.0.0 install: `node installer/driverInstall.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ibm_db@2.0.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.


   โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
   โ”‚                                     โ”‚
   โ”‚   Update available 5.0.0 โ†’ 5.0.3    โ”‚
   โ”‚     Run npm i -g npm to update      โ”‚
   โ”‚                                     โ”‚
   โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ


npm ERR! A complete log of this run can be found in:
npm ERR!     /home/sam/.strong-registry/default.cache/_logs/2017-06-15T17_41_06_303Z-debug.log
ibm/dashdb-nodejs-helloworld (master *% u=) % ls node_modules/ibm_db/installer/clidriver/include
./   sqlca.h    sqlcli.h  sqlenv.h  sql.h       sqlsystm.h
../  sqlcli1.h  sqlda.h   sqlext.h  sqlstate.h
ibm/dashdb-nodejs-helloworld (master *% u=) %

I havenโ€™t read the install script, and have no idea what it is doing, or what could be causing this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Resolving EACCES permissions errors when installing ...
This is the best way to avoid permissions issues. To reinstall npm with a node version manager, follow the steps in "Downloading and...
Read more >
20 - How to prevent permissions errors | npm Documentation
This is the best way to avoid permissions issues. This is described in Chapter 2. You do not need to remove your current...
Read more >
How to fix npm throwing error without sudo - node.js
This looks like a permissions issue in your home directory. To reclaim ownership of the .npm directory execute: sudo chown -R $(whoami) ~/.npm....
Read more >
npm package permissions โ€” an idea - Medium
Option 1: an npm package to enforce securityโ€‹โ€‹ Let's call it @npm/permissions . You would include this @npm/permissions package as the firstย ...
Read more >
Rebuilding node access permissions - Acquia Support
Drupal includes the node_access_rebuild function, which includes a variable to batch the requests. This helps prevent server overloading. Youย ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found