我尝试在运行Ubuntu 20.04的新Azure VM上安装Highcharts导出服务器。我已安装node.js和npm,当我尝试运行npm安装命令时:
sudo npm install highcharts-export-server -g
出现以下错误:
Download already available at /tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2
Verified checksum of previously downloaded file
Extracting tar contents (via spawned process)
Removing /usr/local/lib/node_modules/highcharts-export-server/node_modules/phantomjs-prebuilt/lib/phantom
Copying extracted folder /tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2-extract-1634831384140/phantomjs-2.1.1-linux-x86_64 -> /usr/local/lib/node_modules/highcharts-export-server/node_modules/phantomjs-prebuilt/lib/phantom
Phantom installation failed { [Error: EACCES: permission denied, link '/tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2-extract-1634831384140/phantomjs-2.1.1-linux-x86_64' -> '/usr/local/lib/node_modules/highcharts-export-server/node_modules/phantomjs-prebuilt/lib/phantom']
errno: -13,
code: 'EACCES',
syscall: 'link',
path:
'/tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2-extract-1634831384140/phantomjs-2.1.1-linux-x86_64',
dest:
'/usr/local/lib/node_modules/highcharts-export-server/node_modules/phantomjs-prebuilt/lib/phantom' } Error: EACCES: permission denied, link '/tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2-extract-1634831384140/phantomjs-2.1.1-linux-x86_64' -> '/usr/local/lib/node_modules/highcharts-export-server/node_modules/phantomjs-prebuilt/lib/phantom'
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! phantomjs-prebuilt@2.1.14 install: node install.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the phantomjs-prebuilt@2.1.14 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2021-10-21T15_49_48_318Z-debug.log
下面是一个截图:
我也尝试过使用以下命令单独安装PhantomJS:
sudo npm install -g phantomjs@2.1.1 --unsafe-perm
(See:Why can't I install phantomjs (Error: EACCES: permission denied)?)这没有帮助。
我如何克服这个错误并在我们的虚拟机上安装highcharts?
1条答案
按热度按时间hgb9j2n61#
通过将NPM和nodejs更新到最新版本进行修复