【发布时间】:2021-11-01 12:50:14
【问题描述】:
Image of the error 这是我在多次尝试后不断遇到的错误。我尝试删除节点缓存,我重新安装了 node.js 但找不到成功。 但是,每当我使用管理员或 root 运行它时,我都可以安装它。那么为什么会这样呢?
我已经提供了我的错误截图,但是,我仍然会以书面形式提供错误。
npm ERR! code EPERM
npm ERR! syscall mkdir
npm ERR! path C:\Program Files\nodejs\node_modules\json-server
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, mkdir 'C:\Program Files\nodejs\node_modules\json-server'
npm ERR! [Error: EPERM: operation not permitted, mkdir 'C:\Program Files\nodejs\node_modules\json-server'] {
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'mkdir',
npm ERR! path: 'C:\\Program Files\\nodejs\\node_modules\\json-server'
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.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\7386-85615SG 2913642\AppData\Local\npm-cache\_logs\2021-09-03T06_29_38_211Z-debug.log
【问题讨论】:
-
您需要授予当前用户权限,或者您可以使用当前用户安装节点。
标签: node.js json npm node-modules npm-install