【发布时间】:2019-09-19 02:04:42
【问题描述】:
环境
我正在尝试使用 Ubuntu 18.04 在 Google Cloud 实例上安装 Strapi。我安装了 Node 和 npm(分别为 10.16.3 和 6.9.0)。我在执行 npm install 命令后遇到错误消息。
快速入门不起作用
我曾尝试使用快速入门指南中的$ npx create-strapi-app my-project --quickstart 选项,但这只是挂在Installing dependencies: flatten@1.0.2: I wrote this module a very long time ago; you should use something else.
错误
这是我在命令行中输入的安装 Strapi 的内容:
$ npm install 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 ERR!s 看起来像是权限问题,但始终被建议不要以 root/sudo 身份运行。
我的预期......
为了能够进步到$ strapi new my-project
【问题讨论】: