NodeJS错误:缺少写入权限

时间:2019-06-26 18:13:50

标签: node.js express

我正在尝试设置Express应用程序生成器,并遇到以下错误: 我无法理解为什么拒绝写入访问权限并发生许多错误。

pragyasultania@pragyasultania-Vostro-3578:~/NodeJS/myapp$ npm install express-generator -g
npm WARN checkPermissions Missing write access to /usr/lib/node_modules/express-generator
npm WARN checkPermissions Missing write access to /usr/lib/node_modules
npm ERR! path /usr/lib/node_modules/express-generator
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/usr/lib/node_modules/express-generator'
npm ERR!  { [Error: EACCES: permission denied, access '/usr/lib/node_modules/express-generator']
npm ERR!   stack:
npm ERR!    'Error: EACCES: permission denied, access \'/usr/lib/node_modules/express-generator\'',
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'access',
npm ERR!   path: '/usr/lib/node_modules/express-generator' }
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! 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).

我正在使用Ubuntu操作系统。请指导我要更改操作系统的哪些设置,以便克服这些错误!

0 个答案:

没有答案