gpt4 book ai didi

node.js - EPERM : operation not permitted, mkdir'C :\Program Files\nodejs\node_modules\.登台

转载 作者:行者123 更新时间:2023-12-03 12:13:18 25 4
gpt4 key购买 nike

我正在尝试在项目上运行npm install,但显示EPERM:不允许操作,mkdir'C:\Program Files\nodejs\node_modules.staging

我没有root管理员访问权限。我在系统中以本地用户身份使用,而我的系统是Windows 10

Node 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 ]

最佳答案

尝试清除缓存:

  • npm cache clean --force

  • 或者
  • npm uninstall npm -g
  • npm install npm -g

  • 或者
  • npm set prefix 'C:\Users\User\AppData\Roaming\npm'

  • 最后一个为我工作

    关于node.js - EPERM : operation not permitted, mkdir'C :\Program Files\nodejs\node_modules\.登台,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58078937/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com