我在使用 npm 安装 expo-cli 时遇到问题 [英] I have an issue while installing expo-cli using npm

查看:112
本文介绍了我在使用 npm 安装 expo-cli 时遇到问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

C:\Deezer>npm install --global expo-clinpm 错误!解析 '...dateformat":"3.0.3","'

C:\Deezer>npm install --global expo-cli npm ERR! Unexpected end of JSON input while parsing near '...dateformat":"3.0.3","'

npm 错误!可以在以下位置找到此运行的完整日志:npm 错误!C:\Users\HP\AppData\Roaming\npm-cache_logs\2019-09-01T21_24_34_642Z-debug.log

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\HP\AppData\Roaming\npm-cache_logs\2019-09-01T21_24_34_642Z-debug.log

我尝试了很多方法来解决它.我搜索了所有与之相关的 json 文件.但什么也没发生.

I tried a lot of way to resolve it . I searched in all json files that exist related to it . but nothing happened.

C:\Deezer>npm install --global expo-clinpm 错误!解析 '...dateformat":"3.0.3","'

C:\Deezer>npm install --global expo-cli npm ERR! Unexpected end of JSON input while parsing near '...dateformat":"3.0.3","'

npm 错误!可以在以下位置找到此运行的完整日志:npm 错误!C:\Users\HP\AppData\Roaming\npm-cache_logs\2019-09-01T21_24_34_642Z-debug.log

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\HP\AppData\Roaming\npm-cache_logs\2019-09-01T21_24_34_642Z-debug.log

C:\Deezer>npm install --global expo-clinpm 错误!解析 '...dateformat":"3.0.3","'

C:\Deezer>npm install --global expo-cli npm ERR! Unexpected end of JSON input while parsing near '...dateformat":"3.0.3","'

npm 错误!可以在以下位置找到此运行的完整日志:npm 错误!C:\Users\HP\AppData\Roaming\npm-cache_logs\2019-09-01T21_24_34_642Z-debug.log

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\HP\AppData\Roaming\npm-cache_logs\2019-09-01T21_24_34_642Z-debug.log

推荐答案

我遇到了同样的问题,我通过从给定的 npm 注册表列表中切换 npm reigistry 来解决它.

I had same issue, i solved it by switching npm reigistry from the list of given npm registry.

Npm 注册表列表:

https://registry.npmjs.org/(错误一)

http://r.cnpmjs.org/

https://registry.npm.taobao.org/

https://registry.nodejitsu.com/

http://registry.mirror.cqupt.edu.cn

https://skimdb.npmjs.com/registry

https://npm.open-registry.dev/ (https://open-registry.dev)

切换只需输入

npm 配置集注册表 "https://registry.npmjs.com/"

npm config set registry "https://registry.npmjs.com/"

用上述网址替换注册表网址,检查哪一个适合您.

Replace the registry url with the above urls check which one works for you.

那么:

npm 缓存清除 --force

npm cache clear --force

解决了.

然后你可以安装

这篇关于我在使用 npm 安装 expo-cli 时遇到问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆