代码之家  ›  专栏  ›  技术社区  ›  Sumithran

在gulp安装时出现“请以root/administrator身份再次运行此命令”错误

  •  2
  • Sumithran  · 技术社区  · 7 年前

    在执行此命令时,我正试图在项目中安装gulp

    npm install -g gulp

    我犯了这样的错误:

    npm WARN deprecated gulp-util@3.0.8: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5
    npm WARN deprecated graceful-fs@3.0.11: please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js
    npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
    npm WARN deprecated minimatch@0.2.14: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
    npm WARN deprecated graceful-fs@1.2.3: please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js
    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: '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! Please try running this command again as root/Administrator.
    

    我已经在我的 乌班图 机器。 我该怎么解决?

    1 回复  |  直到 7 年前
        1
  •  1
  •   Alex Mulchinock    7 年前

    试着跑步 sudo npm install -g gulp