vue-cli脚手架安装的艰辛过程

  当我兴高采烈的打开powershell,劈里啪啦的敲下 npm install -g @vue/cli 命令,按下回车的那一瞬间,我就知道事情不简单(内心有千万只草泥马奔腾)。
  没错,报错了,一开始是这样滴:

 core-js@2.6.11: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.

npm WARN tarball tarball data for typescript@~3.7.5 (sha1-BpLiH2X9QQi5MwI4qsEd0uF3oa4=) seems to be corrupted. Trying one more time.
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\LXX\AppData\Roaming\npm\node_modules\.staging\rxjs-4dfdb1a4\util\tryCatch.js'

C:\Users\LXX\AppData\Roaming\npm\node_modules\.staging\typescript-d9175e2c\lib\tsserver.js
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall lstat
npm ERR! Error: EPERM: operation not permitted, lstat 'C:\Users\LXX\AppData\Roaming\npm\node_modules\.staging\typescript-d9175e2c\lib\tsserver.js'
npm ERR!  { [Error: EPERM: operation not permitted, lstat 'C:\Users\LXX\AppData\Roaming\npm\node_modules\.staging\typescript-d9175e2c\lib\tsserver.js']
npm ERR!   cause:
npm ERR!    { Error: EPERM: operation not permitted, lstat 'C:\Users\LXX\AppData\Roaming\npm\node_modules\.staging\typescript-d9175e2c\lib\tsserver.js'
npm ERR!      errno: -4048,
npm ERR!      code: 'EPERM',
npm ERR!      syscall: 'lstat',
npm ERR!      path:
npm ERR!       'C:\\Users\\LXX\\AppData\\Roaming\\npm\\node_modules\\.staging\\typescript-d9175e2c\\lib\\tsserver.js' },
npm ERR!   stack:
npm ERR!    'Error: EPERM: operation not permitted, lstat \'C:\\Users\\LXX\\AppData\\Roaming\\npm\\node_modules\\.staging\\typescript-d9175e2c\\lib\\tsserver.js\'',
npm ERR!   errno: -4048,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'lstat',
npm ERR!   path:
npm ERR!    'C:\\Users\\LXX\\AppData\\Roaming\\npm\\node_modules\\.staging\\typescript-d9175e2c\\lib\\tsserver.js',
npm ERR!   parent: '@vue/cli' }
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).

 core-js@2.6.11: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.

我寻思可能出在这里,百度了一下,执行了 npm install --save -g core-js@^3
在这里插入图片描述
  无果!继续。。
  有人说可能是npm版本低,于是我升级了一下,npm install -g npm
  后续这样滴。。。
在这里插入图片描述
  我想可能是安装失败的时候有文件残存,又搜了一下,npm cache clear -force,终端powershell回应…sure…doing…什么的,但是还是没用,我已经安装了不下4次。。。
  于是乎,我找到node.js的全局安装路径,C:\Users****\AppData\Roaming\npm\node_modules
下,删了这两个文件夹.staging@vue 是前面安装失败留下的文件。
  安装了还是失败.
  继续执行了npm cache clear -force,再删了这两个文件夹.staging@vue
最有安装了一次,恍恍惚惚的就成功了!
  下面是我的node和npm的版本号
在这里插入图片描述
在这里插入图片描述
于是执行 vue -V测试一下,
在这里插入图片描述
没成功?
nonono,这是你笔记本禁止运行脚本,解决办法
输入 set-ExecutionPolicy RemoteSigned
在这里插入图片描述
选择 Y或者A,回车
在测试一遍
在这里插入图片描述
搞定!

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值