【问题标题】:I am trying to install gulp on linux kubuntu but i have such problem我正在尝试在 linux kubuntu 上安装 gulp 但我有这样的问题
【发布时间】:2019-03-30 09:24:42
【问题描述】:

我安装了 node 和 npm 但我无法安装 gulp

在成功安装 node 和 npm 后,我尝试了npm install -g gulp

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/dilmurod/.npm/_logs/2019-03-30T09_01_16_977Z-debug.log```

【问题讨论】:

  • 您需要 root 权限才能全局安装软件包。使用 sudo - sudo npm install -g gulp 运行它
  • 错误日志再明确不过了。

标签: node.js gulp npm-install


【解决方案1】:

默认情况下,当您使用 g 标志运行 npm install package_name -g 时,它会存储在 /usr/lib/node_modules/ 文件夹中

如果正在执行命令npm install -g的当前用户没有/usr/lib/的写权限,则会出现此错误

使用 root 用户sudo npm install gulp -g

执行此操作

【讨论】:

    猜你喜欢
    • 2019-06-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多