使用npm在Ubuntu18.04上安装Strapi的问题 环境

使用npm在Ubuntu18.04上安装Strapi的问题 环境,npm,strapi,Npm,Strapi,我正试图用Ubuntu 18.04在谷歌云实例上安装Strapi。我已经安装了Node和npm(分别为10.16.3和6.9.0版)。在执行npm install命令后,我遇到一条错误消息 快速启动不起作用 我曾尝试使用《快速入门指南》中的$npx create strapi app my project--quickstart选项,但这仅适用于安装依赖项:flatten@1.0.2:我很久以前写过这个模块;你应该用别的东西。 错误 以下是我在命令行中输入的安装Strapi的内容: $npm安装

我正试图用Ubuntu 18.04在谷歌云实例上安装Strapi。我已经安装了Node和npm(分别为10.16.3和6.9.0版)。在执行npm install命令后,我遇到一条错误消息

快速启动不起作用 我曾尝试使用《快速入门指南》中的
$npx create strapi app my project--quickstart
选项,但这仅适用于
安装依赖项:flatten@1.0.2:我很久以前写过这个模块;你应该用别的东西。

错误 以下是我在命令行中输入的安装Strapi的内容:

$npm安装strapi@beta-g

以下是产生的错误:

npm WARN deprecated boom@7.3.0: This module has moved and is now available at @hapi/boom. Please update your dependencies as this version is no longer maintained an may contain bugs and security issues. 
npm WARN deprecated hoek@6.1.3: This module has moved and is now available at @hapi/hoek. Please update your dependencies as this version is no longer maintained an may contain bugs and security issues. 
npm WARN checkPermissions Missing write access to /usr/lib/node_modules.
npm ERR! path /usr/lib/node_modules.
npm ERR! code EACCES 
npm ERR! errno -13 
npm ERR! syscall access 
npm ERR! Error: EACCES: permission denied, access '/usr/lib/node_modules' 
npm ERR!  { [Error: EACCES: permission denied, access'/usr/lib/node_modules'] 
npm ERR!   stack: 
npm ERR!   'Error: EACCES: permission denied, access\'/usr/lib/node_modules\'', 
npm ERR!   errno: -13, 
npm ERR!   code: 'EACCES', 
npm ERR!   syscall: 'access', 
npm ERR!   path: '/usr/lib/node_modules' } 
npm ERR! 
npm ERR! The operation was rejected by your operating system. 
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR! 
npm ERR! If you believe this might be a permissions issue, please double-check the 
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator (though this is not recommended). 
npm ERR! A complete log of this run can be found in: 
npm ERR!     /home/justme/.npm/_logs/2019-09-19T01_52_40_382Z-debug.log
一些警告和一些npm错误!s看起来像是权限问题,但始终建议不要以root/sudo身份运行

我所期望的。。。
为了能够进展到
$strapi new my project

,您要么以root用户身份运行该项目,要么使用sudo

npm错误!代码选择

这不是一个Strapi问题,您永远不应该将npm用作根用户或使用sudo


您要么以root用户身份运行,要么使用sudo

npm错误!代码选择

这不是一个Strapi问题,您永远不应该将npm用作根用户或使用sudo


该命令不是由root用户或使用sudo权限运行的。用户是myname(不是root),命令是
$npm installstrapi@beta-g
权限问题似乎是npm默认目录。按照@derrek mehaffy的答案中关于如何更改第一个链接上的默认目录的指南,解决了EACCES问题,但不幸的是,我仍然在安装依赖项时遇到挂起问题:flatten@1.0.2:我很久以前写过这个模块;您应该使用其他方法。进程永远无法通过此操作。该命令不是由root用户或使用sudo权限运行的。用户是myname(不是root),命令是
$npm installstrapi@beta-g
权限问题似乎是npm默认目录。按照@derrek mehaffy的答案中关于如何更改第一个链接上的默认目录的指南,解决了EACCES问题,但不幸的是,我仍然在安装依赖项时遇到挂起问题:flatten@1.0.2:我很久以前写过这个模块;您应该使用其他方法。此过程永远无法通过。