使用-g选项时,我无法安装svg2png节点模块。如果没有-g选项,它可以很好地安装。我安装了phantomJs,并通过在/ usr / bin / phantomjs中建立到另一个目录中安装的phantomjs的软链接来确保phantomjs是可访问的。我使用
本身安装了phantomjs npm install phantomjs-prebuilt
这是我得到的输出:
/usr/bin/svg2png -> /usr/lib/node_modules/svg2png/bin/svg2png-cli.js
> phantomjs-prebuilt@2.1.16 install /usr/lib/node_modules/svg2png/node_modules/phantomjs-prebuilt
> node install.js
PhantomJS not found on PATH
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/lib/node_modules/svg2png/node_modules/phantomjs-prebuilt/lib/phantom
Copying extracted folder /tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2-extract-1537780087981/phantomjs-2.1.1-linux-x86_64 -> /usr/lib/node_modules/svg2png/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-1537780087981/phantomjs-2.1.1-linux-x86_64' -> '/usr/lib/node_modules/svg2png/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-1537780087981/phantomjs-2.1.1-linux-x86_64',
dest: '/usr/lib/node_modules/svg2png/node_modules/phantomjs-prebuilt/lib/phantom' } Error: EACCES: permission denied, link '/tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2-extract-1537780087981/phantomjs-2.1.1-linux-x86_64' -> '/usr/lib/node_modules/svg2png/node_modules/phantomjs-prebuilt/lib/phantom'
似乎是什么问题?
〜
〜
〜