0

I am not able to install it. Following error occurred while instilling.

testing@testing-VirtualBox:~$ npm install influxdb-cli -g

 npm http GET registry.npmjs.org/influxdb-cli

 npm http GET registry.npmjs.org/influxdb-cli

 npm http 304 registry.npmjs.org/influxdb-cli

 npm ERR! Error: EACCES, mkdir '/usr/local/lib/node_modules/influxdb-cli'

 npm ERR!  { [Error: EACCES, mkdir '/usr/local/lib/node_modules/influxdb-cli']

 npm ERR!   errno: 3,

npm ERR!   code: 'EACCES',

npm ERR!   path: '/usr/local/lib/node_modules/influxdb-cli',

npm ERR!   fstream_type: 'Directory',

npm ERR!   fstream_path: '/usr/local/lib/node_modules/influxdb-cli',

npm ERR!   fstream_class: 'DirWriter',

npm ERR!   fstream_stack: 

npm ERR!    [ '/usr/lib/nodejs/fstream/lib/dir-writer.js:36:23',

npm ERR!      '/usr/lib/nodejs/mkdirp/index.js:51:17',

npm ERR!      'Object.oncomplete (fs.js:107:15)' ] }

npm ERR! 

npm ERR! Please try running this command again as root/Administrator.


npm ERR! System Linux 3.11.0-12-generic

npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "influxdb-cli" "-g"

npm ERR! cwd /home/testing

npm ERR! node -v v0.10.15

npm ERR! npm -v 1.2.18

npm ERR! path /usr/local/lib/node_modules/influxdb-cli

npm ERR! fstream_path /usr/local/lib/node_modules/influxdb-cli

npm ERR! fstream_type Directory

npm ERR! fstream_class DirWriter

npm ERR! code EACCES

npm ERR! errno 3

npm ERR! stack Error: EACCES, mkdir '/usr/local/lib/node_modules/influxdb-cli'

npm ERR! fstream_stack /usr/lib/nodejs/fstream/lib/dir-writer.js:36:23

npm ERR! fstream_stack /usr/lib/nodejs/mkdirp/index.js:51:17

npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)

npm ERR! 

npm ERR! Additional logging details can be found in:

npm ERR!     /home/testing/npm-debug.log

npm ERR! not ok code 0
Youbaraj Sharma
  • 1,295
  • 3
  • 17
  • 34
Sujit Rai
  • 445
  • 6
  • 10

3 Answers3

0

Looks like you have to use sudo when specifying the -g flag as answered here: npm install failing

Community
  • 1
  • 1
Paul Dix
  • 1,967
  • 16
  • 8
0

Yes, sudo is required also nodejs 10.0+ should be installed before calling this command.

npm install influxdb-cli -g

Sujit Rai
  • 445
  • 6
  • 10
0

sudo should fix your problem sudo npm install influxdb-cli -g, but it isn't mandatory to use sudo in order to install node package binaries, you can follow these instructions: "set a local node prefix":

echo prefix = ~/.node >> ~/.npmrc

export $PATH=$HOME/.node/bin:$PATH

to install node packages in your home directory without requiring /usr/ permissions.

I created a ruby influxdb-cli, which uses ruby instead of node. Besides the InfluxDB Query Language, it also supports InfluxDB API calls through db variable.

gem install influxdb-cli.

The Getting Started Guide is available on GitHub:

https://github.com/phstc/influxdb-cli

Community
  • 1
  • 1
Pablo Cantero
  • 6,239
  • 4
  • 33
  • 44