复制完安装那两个包的代码 然后回车 然后就报错了 安装不上 请问老师怎么解决

来源:2-3 使用 Babel 前的准备工作

weixin_慕村1291783

2020-12-01 11:26:43

# 具体遇到的问题

# 报错信息的截图

# 相关课程内容截图

# 尝试过的解决思路和结果

# 粘贴全部相关代码,切记添加代码注释(请勿截图)

D:\Babel与webpack\1.babel\3.使用Babel前的准备工作>npm install --save-dev @babel/core @babel/cli

npm ERR! code EPERM

npm ERR! syscall open

npm ERR! path C:\Program Files\nodejs\node_cache\_cacache\tmp\5b56a96b

npm ERR! errno -4048

npm ERR! Error: EPERM: operation not permitted, open 'C:\Program Files\nodejs\node_cache\_cacache\tmp\5b56a96b'

npm ERR!  [OperationalError: EPERM: operation not permitted, open 'C:\Program Files\nodejs\node_cache\_cacache\tmp\5b56a96b'] {

npm ERR!   cause: [Error: EPERM: operation not permitted, open 'C:\Program Files\nodejs\node_cache\_cacache\tmp\5b56a96b'] {

npm ERR!     errno: -4048,

npm ERR!     code: 'EPERM',

npm ERR!     syscall: 'open',

npm ERR!     path: 'C:\\Program Files\\nodejs\\node_cache\\_cacache\\tmp\\5b56a96b'

npm ERR!   },

npm ERR!   isOperational: true,

npm ERR!   errno: -4048,

npm ERR!   code: 'EPERM',

npm ERR!   syscall: 'open',

npm ERR!   path: 'C:\\Program Files\\nodejs\\node_cache\\_cacache\\tmp\\5b56a96b'

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! code EPERM

npm ERR! syscall open

npm ERR! path C:\Program Files\nodejs\node_cache\_cacache\tmp\c0cc0beb

npm ERR! errno -4048

npm ERR! Error: EPERM: operation not permitted, open 'C:\Program Files\nodejs\node_cache\_cacache\tmp\c0cc0beb'

npm ERR!  [OperationalError: EPERM: operation not permitted, open 'C:\Program Files\nodejs\node_cache\_cacache\tmp\c0cc0beb'] {

npm ERR!   cause: [Error: EPERM: operation not permitted, open 'C:\Program Files\nodejs\node_cache\_cacache\tmp\c0cc0beb'] {

npm ERR!     errno: -4048,

npm ERR!     code: 'EPERM',

npm ERR!     syscall: 'open',

npm ERR!     path: 'C:\\Program Files\\nodejs\\node_cache\\_cacache\\tmp\\c0cc0beb'

npm ERR!   },

npm ERR!   isOperational: true,

npm ERR!   errno: -4048,

npm ERR!   code: 'EPERM',

npm ERR!   syscall: 'open',

npm ERR!   path: 'C:\\Program Files\\nodejs\\node_cache\\_cacache\\tmp\\c0cc0beb'

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.


写回答

1回答

好帮手慕言

2020-12-01

同学你好,解答如下:

1、运行下方命令之后,重新安装。

npm cache clean --force

2、如果上述方法不能解决问题,建议:安装淘宝镜像。

npm install -g cnpm --registry=https://registry.npm.taobao.org

安装完成之后,再下载依赖可以将npm 换成cnpm。例如:npm install  XXX可以换成cnpm install XXX 

祝学习愉快~

0

0 学习 · 15276 问题

查看课程