【问题标题】:Installing discordjs/opus over normal discord.js has an error在普通的 discord.js 上安装 discordjs/opus 有错误
【发布时间】:2021-05-10 17:45:51
【问题描述】:

最近,我问了一个问题,是否可以在已安装的 discordjs here 之上安装 discordjs/opus。我被告知它可能不会有任何问题,但事实并非如此。这是它在安装时发送的错误:

npm ERR! code EPERM
npm ERR! syscall rename
npm ERR! path C:\Users\MYNAME\OneDrive\Documents\GitHub\discordbot\node_modules\ws\package.json.3640863801
npm ERR! dest C:\Users\MYNAME\OneDrive\Documents\GitHub\discordbot\node_modules\ws\package.json
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, rename 'C:\Users\MYNAME\OneDrive\Documents\GitHub\discordbot\node_modules\ws\package.json.3640863801' -> 'C:\Users\MYNAME\OneDrive\Documents\GitHub\beansdiscordbot\node_modules\ws\package.json'
npm ERR!  [OperationalError: EPERM: operation not permitted, rename 'C:\Users\MYNAME\OneDrive\Documents\GitHub\discordbot\node_modules\ws\package.json.3640863801' -> 'C:\Users\MYNAME\OneDrive\Documents\GitHub\beansdiscordbot\node_modules\ws\package.json'] {
npm ERR!   cause: [Error: EPERM: operation not permitted, rename 'C:\Users\MYNAME\OneDrive\Documents\GitHub\discordbot\node_modules\ws\package.json.3640863801' -> 'C:\Users\MYNAME\OneDrive\Documents\GitHub\beansdiscordbot\node_modules\ws\package.json'] {
npm ERR!     errno: -4048,
npm ERR!     code: 'EPERM',
npm ERR!     syscall: 'rename',
npm ERR!     path: 'C:\\Users\\MYNAME\\OneDrive\\Documents\\GitHub\\discordbot\\node_modules\\ws\\package.json.3640863801',
npm ERR!     dest: 'C:\\Users\\MYNAME\\OneDrive\\Documents\\GitHub\\discordbot\\node_modules\\ws\\package.json'
npm ERR!   },
npm ERR!   errno: -4048,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'rename',
npm ERR!   path: 'C:\\Users\\MYNAME\\OneDrive\\Documents\\GitHub\\discordbot\\node_modules\\ws\\package.json.3640863801',
npm ERR!   dest: 'C:\\Users\\MYNAME\\OneDrive\\Documents\\GitHub\\discordbot\\node_modules\\ws\\package.json',
npm ERR!   parent: 'discordbot'
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.

(我用“MYNAME”替换了我的真实姓名)

如果我能解决这个问题,我们将不胜感激。

【问题讨论】:

    标签: node.js npm discord.js npm-install


    【解决方案1】:

    您应该使用右键单击 > 以管理员身份运行来打开 Powershell。并重试。它会起作用,这是一个简单的权限问题。

    【讨论】:

    • 刚试过这个并运行 npm install discord.js @discordjs/opus,然后它说这个错误:Error: Cannot find module 'discord.js' 我不得不回滚,因为它崩溃了。您能否就如何解决此问题提供任何建议/帮助:)?
    • 使用 npm install discord.js
    猜你喜欢
    • 2021-07-24
    • 2021-08-09
    • 2021-08-26
    • 2021-04-29
    • 2020-05-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-01-29
    相关资源
    最近更新 更多