Ubuntu 试图安装gatsby cli时出错

Ubuntu 试图安装gatsby cli时出错,ubuntu,npm,gatsby,Ubuntu,Npm,Gatsby,当我尝试安装gatsby时,它已成功安装,但在gatsby cli期间出现错误,如下所述 [Container]2020/06/24 17:33:22运行命令npm install-g gatsby cli npm警告弃用的内核-js@2.6.11:core js@'/usr/local/bin/gatsby' npm错误!文件存在:/usr/local/bin/gatsby npm错误!请删除现有文件并重试,或运行npm npm错误!使用--force轻率地覆盖文件。 npm错误!此运行的

当我尝试安装gatsby时,它已成功安装,但在gatsby cli期间出现错误,如下所述


[Container]2020/06/24 17:33:22运行命令npm install-g gatsby cli
npm警告弃用的内核-js@2.6.11:core js@'/usr/local/bin/gatsby'
npm错误!文件存在:/usr/local/bin/gatsby
npm错误!请删除现有文件并重试,或运行npm
npm错误!使用--force轻率地覆盖文件。
npm错误!此运行的完整日志可在以下位置找到:
npm错误/root/.npm/_logs/2020-06-24T17_33_41_230Z-debug.log
[Container]2020/06/24 17:33:41命令未成功退出npm安装-g gatsby cli退出状态239
[容器]2020/06/24 17:33:41阶段完成:安装状态:失败
[容器]2020/06/24 17:33:41阶段上下文状态代码:命令执行错误消息:
执行命令时出错:npm install-g gatsby cli。原因:退出状态239

由于软件包已存在的原因,它似乎失败了。尝试卸载它,然后重新安装:
npm uninstall-g gatsby cli
,然后:
npm install-g gatsby cli
。让我知道这有帮助。如果有,我会写它作为一个答案:)我尝试卸载,但错误不删除(相同的错误)它的show gatsby cli已经存在,所以我通过只安装{npm I-g gatsby}和它现在的工作来解决(再次离开gatsby cli的安装),所以只安装gatsby修复了它?是的,它解决了问题
[Container] 2020/06/24 17:33:22 Running command npm install -g gatsby-cli

npm WARN deprecated core-js@2.6.11: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.

npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated

npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated

npm WARN acorn-dynamic-import@4.0.0 requires a peer of acorn@^6.0.0 but none is installed. You must install peer dependencies yourself.

npm ERR! code EEXIST

npm ERR! syscall symlink

npm ERR! path ../lib/node_modules/gatsby-cli/cli.js

npm ERR! dest /usr/local/bin/gatsby

npm ERR! errno -17

npm ERR! EEXIST: file already exists, symlink '../lib/node_modules/gatsby-cli/cli.js' -> '/usr/local/bin/gatsby'

npm ERR! File exists: /usr/local/bin/gatsby

npm ERR! Remove the existing file and try again, or run npm

npm ERR! with --force to overwrite files recklessly.

npm ERR! A complete log of this run can be found in:

npm ERR!     /root/.npm/_logs/2020-06-24T17_33_41_230Z-debug.log

[Container] 2020/06/24 17:33:41 Command did not exit successfully npm install -g gatsby-cli exit status 239

[Container] 2020/06/24 17:33:41 Phase complete: INSTALL State: FAILED

[Container] 2020/06/24 17:33:41 Phase context status code: COMMAND_EXECUTION_ERROR Message:
 
Error while executing command: npm install -g gatsby-cli. Reason: exit status 239