2013-12-10 79 views
0

我無法安裝它。灌注後發生以下錯誤。有沒有人用influxdb cli?

[email protected]:~$ 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 

回答

0

是的,需要須藤也10.0+的NodeJS應該調用此命令之前安裝。

NPM安裝influxdb-CLI -g

0

sudo應該解決您的問題sudo npm install influxdb-cli -g,但它不是強制性的,以安裝節點包二進制文件使用sudo,則可以按照以下說明:"set a local node prefix"

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

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

將節點包安裝到您的主目錄中,而不需要/usr/權限。

我創建了一個ruby influxdb-cli,它使用ruby而不是節點。除了InfluxDB查詢語言之外,它還支持通過db變量的InfluxDB API調用。

gem install influxdb-cli

入門指南可在GitHub上:

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