我正尝试在我的项目上运行npm install,但它显示不允许EPERM:操作,mkdir 'C:\Program Files\nodejs\node_modules.staging
我没有root管理访问权限。我在我的系统中作为本地用户使用,我的系统是windows 10
节点v10.16.3 npm v6.11.3
有谁能帮我解决这个问题吗?我请求你们。
3235 error code EPERM
3236 error syscall mkdir
3237 error path C:\Program Files\nodejs\node_modules\.staging
3238 error errno -4048
3239 error Error: EPERM: operation not permitted, mkdir 'C:\Program Files\nodejs\node_modules\.staging'
3239 error { [Error: EPERM: operation not permitted, mkdir 'C:\Program Files\nodejs\node_modules\.staging']
3239 error cause:
3239 error { Error: EPERM: operation not permitted, mkdir 'C:\Program Files\nodejs\node_modules\.staging'
3239 error errno: -4048,
3239 error code: 'EPERM',
3239 error syscall: 'mkdir',
3239 error path: 'C:\\Program Files\\nodejs\\node_modules\\.staging' },
3239 error stack:
3239 error 'Error: EPERM: operation not permitted, mkdir \'C:\\Program Files\\nodejs\\node_modules\\.staging\'',
3239 error errno: -4048,
3239 error code: 'EPERM',
3239 error syscall: 'mkdir',
3239 error path: 'C:\\Program Files\\nodejs\\node_modules\\.staging',
3239 error parent: 'nodemon' }
3240 error The operation was rejected by your operating system.
3240 error It's possible that the file was already in use (by a text editor or antivirus),
3240 error or that you lack permissions to access it.
3240 error
3240 error If you believe this might be a permissions issue, please double-check the
3240 error permissions of the file and its containing directories, or try running
3240 error the command again as root/Administrator.
3241 verbose exit [ -4048, true ]发布于 2019-11-18 19:02:10
尝试清除缓存:
npm cache clean --force或
npm uninstall npm -gnpm install npm -g或
npm set prefix 'C:\Users\User\AppData\Roaming\npm'最后一个对我很有效
发布于 2020-02-16 16:03:16
运行以下命令:
npm uninstall -g create-react-app
npm install -g create-react-app这将升级您的npx,然后运行
npx create-react-app my-app发布于 2020-01-17 17:30:57
以管理员身份打开命令行(CMD)。导航到您的项目目录。全局安装软件包,例如nodemon或任何其他npm软件包。
这对我很有效。
https://stackoverflow.com/questions/58078937
复制相似问题