安装Firebase失败-操作系统拒绝了该操作

时间:2019-01-24 02:49:11

标签: firebase npm

在win10 / node 10.15 / npm 6.5上安装Firebase时遇到错误。 npmfirebase有问题吗?

PS C:\d\code\js\chatapp> npm i firebase
npm ERR! path C:\d\code\js\chatapp\node_modules\.staging\abbrev-df1c0dbe
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall unlink
npm ERR! Error: EPERM: operation not permitted, unlink 'C:\d\code\js\chatapp\node_modules\.staging\abbrev-df1c0dbe'
npm ERR!  { [Error: EPERM: operation not permitted, unlink 'C:\d\code\js\chatapp\node_modules\.staging\abbrev-df1c0dbe']
npm ERR!   stack:
npm ERR!    'Error: EPERM: operation not permitted, unlink \'C:\\d\\code\\js\\chatapp\\node_modules\\.staging\\abbrev-df1c0dbe\'',
npm ERR!   errno: -4048,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'unlink',
npm ERR!   path:
npm ERR!    'C:\\d\\code\\js\\chatapp\\node_modules\\.staging\\abbrev-df1c0dbe' }
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 (though this is not recommended).

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\JunC\AppData\Roaming\npm-cache\_logs\2019-01-24T00_19_36_447Z-debug.log
PS C:\d\code\js\chatapp> npm i firebase --save
npm ERR! path C:\d\code\js\chatapp\node_modules\.staging\abbrev-df1c0dbe
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall unlink
npm ERR! Error: EPERM: operation not permitted, unlink 'C:\d\code\js\chatapp\node_modules\.staging\abbrev-df1c0dbe'
npm ERR!  { [Error: EPERM: operation not permitted, unlink 'C:\d\code\js\chatapp\node_modules\.staging\abbrev-df1c0dbe']
npm ERR!   stack:
npm ERR!    'Error: EPERM: operation not permitted, unlink \'C:\\d\\code\\js\\chatapp\\node_modules\\.staging\\abbrev-df1c0dbe\'',
npm ERR!   errno: -4048,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'unlink',
npm ERR!   path:
npm ERR!    'C:\\d\\code\\js\\chatapp\\node_modules\\.staging\\abbrev-df1c0dbe' }
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 (though this is not recommended).

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\AppData\Roaming\npm-cache\_logs\2019-01-24T00_26_23_292Z-debug.log

这是日志的错误部分:

1509 verbose stack Error: EPERM: operation not permitted, unlink 'C:\d\code\js\chatapp\node_modules\.staging\balanced-match-a5e1c98f'
1510 verbose cwd C:\d\code\js\chatapp
1511 verbose Windows_NT 10.0.17134
1512 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "i" "firebase"
1513 verbose node v10.15.0
1514 verbose npm  v6.4.1
1515 error path C:\d\code\js\chatapp\node_modules\.staging\balanced-match-a5e1c98f
1516 error code EPERM
1517 error errno -4048
1518 error syscall unlink
1519 error Error: EPERM: operation not permitted, unlink 'C:\d\code\js\chatapp\node_modules\.staging\balanced-match-a5e1c98f'
1519 error  { [Error: EPERM: operation not permitted, unlink 'C:\d\code\js\chatapp\node_modules\.staging\balanced-match-a5e1c98f']
1519 error   stack:
1519 error    'Error: EPERM: operation not permitted, unlink \'C:\\d\\code\\js\\chatapp\\node_modules\\.staging\\balanced-match-a5e1c98f\'',
1519 error   errno: -4048,
1519 error   code: 'EPERM',
1519 error   syscall: 'unlink',
1519 error   path:
1519 error    'C:\\d\\code\\js\\chatapp\\node_modules\\.staging\\balanced-match-a5e1c98f' }
1520 error The operation was rejected by your operating system.
1520 error It's possible that the file was already in use (by a text editor or antivirus),
1520 error or that you lack permissions to access it.
1520 error
1520 error If you believe this might be a permissions issue, please double-check the
1520 error permissions of the file and its containing directories, or try running
1520 error the command again as root/Administrator (though this is not recommended).
1521 verbose exit [ -4048, true ]

1 个答案:

答案 0 :(得分:1)

我所做的是将npm更新为6.8.0。然后安装成功完成。