elasticsearch-head插件安裝運行npm install,可能存在的Head插件phantomjs權限問題

在elasticsearch-head源碼目錄中,執行npm install:

1 npm install

在運行npm install時,可能會存在Head插件phantomjs權限問題:

複製代碼
 1 [root@localhost elasticsearch-head]# npm install
 2 phantomjs-prebuilt@2.1.16 install /usr/local/elasticsearch-head/node_modules/phantomjs-prebuilt
 3 node install.js
 4 PhantomJS not found on PATH
 5 Download already available at /tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2
 6 Verified checksum of previously downloaded file
 7 Extracting tar contents (via spawned process)
 8 Removing /usr/local/elasticsearch-head/node_modules/phantomjs-prebuilt/lib/phantom
 9 Copying extracted folder /tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2-extract-1513568757772/phantomjs-2.1.1-linux-x86_64 -> /usr/local/elasticsearch-head/node_modules/phantomjs-prebuilt/lib/phantom
10 Phantom installation failed { Error: EACCES: permission denied, link '/tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2-extract-1513568757772/phantomjs-2.1.1-linux-x86_64' -> '/usr/local/elasticsearch-head/node_modules/phantomjs-prebuilt/lib/phantom'
11   errno: -13,
12   code: 'EACCES',
13   syscall: 'link',
14   path: '/tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2-extract-1513568757772/phantomjs-2.1.1-linux-x86_64',
15   dest: '/usr/local/elasticsearch-head/node_modules/phantomjs-prebuilt/lib/phantom' } Error: EACCES: permission denied, link '/tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2-extract-1513568757772/phantomjs-2.1.1-linux-x86_64' -> '/usr/local/elasticsearch-head/node_modules/phantomjs-prebuilt/lib/phantom'
16 npm WARN elasticsearch-head@0.0.0 license should be a valid SPDX license expression
17 npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules/fsevents):
18 npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
19 
20 npm ERR! code ELIFECYCLE
21 npm ERR! errno 1
22 npm ERR! phantomjs-prebuilt@2.1.16 install: `node install.js`
23 npm ERR! Exit status 1
24 npm ERR! 
25 npm ERR! Failed at the phantomjs-prebuilt@2.1.16 install script.
26 npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
27 
28 npm ERR! A complete log of this run can be found in:
29 npm ERR!     /root/.npm/_logs/2017-12-18T03_46_03_878Z-debug.log
複製代碼

解決方法,在npm install命令後加 -g 參數:

1 npm install -g

最後,在elasticsearch-head源代碼目錄下啓動nodejs,運行 grunt server。 
運行成功後,訪問 http://localhost:9100 網站,即可看到elasticsearch的相關信息: 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章