错误发生意外错误:“ https://registry.yarnpkg.com/react-native-template-react-native-template-typescript:未找到”

时间:2019-09-24 10:52:40

标签: typescript react-native

卸载react-native-cli后 我运行以下命令以使用打字稿模板启动RN项目:

npx react-native init MyApp --template react-native-template-typescript

但我收到此错误:

  

警告玩笑> jest-cli> jest-config> jest-environment-jsdom> jsdom

     
    

left-pad@1.3.0:使用String.prototype.padStart()错误发生意外错误:     “ https://registry.yarnpkg.com/react-native-template-react-native-template-typescript:     找不到“ .info如果您认为这是一个错误,请打开.....
    [1/2]卸下模块     react-native-template-react-native-template-typescript ...
    错误未在package.json文件中指定此模块。
    信息请访问https://yarnpkg.com/en/docs/cli/remove以获取文档     关于此命令。警告     无法清理中的模板临时文件     node_modules / react-native-template-react-native-template-typescript。     这不是一个严重的错误,您可以在自己的应用上进行操作。
    (节点:8548)UnhandledPromiseRejectionWarning:错误:命令失败:     纱线添加反应本机模板反应本机模板打字稿

  

4 个答案:

答案 0 :(得分:2)

已解决:我也必须使用纱线去除反应性的天然cli

  

纱线移除全局react-native-cli

答案 1 :(得分:2)

删除旧版react-native-cli

npm uninstall -g react-native-cli

从“ react-native-community”安装新的:

npm i -g @react-native-community/cli

然后,使用以下命令初始化项目:

npx react-native init MyApp --template react-native-template-typescript

答案 2 :(得分:0)

我找到的最佳解决方案

删除

npm uninstall -g react-native-cli

创建项目所在的文件夹

mkdir [folder name] && cd [folder name]

安装依赖项,一切正常

yarn init
yarn add react-native
yarn react-native init [Project Name] ...

答案 3 :(得分:0)

import requests from bs4 import BeautifulSoup import urllib.request url = 'https://www.biorxiv.org/content/10.1101/716043v1.full' response = requests.get(url) soup = BeautifulSoup(response.text, 'html.parser') images = soup.find_all('div',{'class':'fig-inline-img'}) for each in images: fig = '_'.join(each.find('img')['alt'].replace('.','').split()) img_link = each.find('a')['href'] picture = urllib.request.urlretrieve(img_link, "{fig}.jpg".format(fig=fig)) print ('Saved: {fig}'.format(fig=fig))

--ignore-existing