我正在尝试安装npm软件包,但无法正常工作。 Error: EPERM: operation not permitted, mkdir 'C:\Users\HAMZA~1'
我写了这个命令,
$ npm install -g create-react-app
它会引发以下错误:
npm ERR! code EPERM
npm ERR! syscall mkdir
npm ERR! path C:\Users\HAMZA~1
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, mkdir 'C:\Users\HAMZA~1'
npm ERR! [OperationalError: EPERM: operation not permitted, mkdir 'C:\Users\HAMZA~1'] {
npm ERR! cause: [Error: EPERM: operation not permitted, mkdir 'C:\Users\HAMZA~1'] {
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'mkdir',
npm ERR! path: 'C:\\Users\\HAMZA~1'
npm ERR! },
npm ERR! isOperational: true,
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'mkdir',
npm ERR! path: 'C:\\Users\\HAMZA~1'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It's possible that the file was already in use (by a text editor or antivirus),
npm ERR! or that you lack permissions to access it.
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.
是什么意思?我该如何解决?
答案 0 :(得分:1)
尝试从具有管理员权限的命令提示符下运行“ npm install”。 在Windows中,请在“开始”菜单的“附件”文件夹中查找它,或右键单击“开始”按钮,然后在那里可以打开“命令提示符(管理员)”。
在Linux中,使用sudo ...