标签可能没有任何编码URIComponent编码的字符 [英] Tags may not have any characters that encodeURIComponent encodes

查看:746
本文介绍了标签可能没有任何编码URIComponent编码的字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在从凉亭迁移到纱线,并且在我的 bower.json 文件中,我具有以下依赖性:

I'm migrating from bower to yarn, and in my bower.json file I have this dependency:

Snap.svg": "snap.svg#^0.4.1

当我尝试在纱线依赖文件中执行相同操作时,出现此错误:

When I tried to do the same in the yarn dependencies file, I got this error :

npm ERR! code EINVALIDTAGNAME
npm ERR! Invalid tag name "snap.svg@^0.4.1": Tags may not have any characters that encodeURIComponent encodes.

我该如何解决?

推荐答案

两件事情:

首先是npm软件包名称-yarn使用软件包而使用的名称。 json -是 snapsvg ,而 snap.svg (带点)仅用于为凉亭。请参见 snapsvg npm页面

First, the npm package name -- which yarn uses since it uses package.json -- is snapsvg whereas snap.svg (with a dot) is only used for Bower. See the snapsvg npm page. The error you see is in reference to that dot in the package name.

第二,当我测试用纱线1.2.1安装它时,我注意到它抱怨0.4 .1不可用:

Second, when I test installed it with yarn 1.2.1, I noticed that it complained that 0.4.1 was not available:

Couldn't find any versions for "snapsvg" that matches "^0.4.1"
? Please choose a version of "snapsvg" from this list: (Use arrow keys)
> 0.5.1
  0.5.0
  0.4.0
  0.3.0
  0.1.0

生成的 package.json 条目应类似于:

"dependencies": {
  "snapsvg": "^0.4.0"
}

yarn.lock

snapsvg@^0.4.0:
  version "0.4.0"
  resolved "https://registry.yarnpkg.com/snapsvg/-/snapsvg-0.4.0.tgz#e0767014167825957de7e125c29b0fa89796ea03"
  dependencies:
    eve "~0.4.2"

通常,当某些东西很奇怪时发生这种情况,请使用 纱线添加 手动输入软件包名称,然后查看它的作用。

Generally, when something weird like this happens, use yarn add with the package name manually and see what it does.

这篇关于标签可能没有任何编码URIComponent编码的字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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