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.
How can I solve this ?
Two things:
First, the npm package name -- which yarn uses since it uses
package.json
-- issnapsvg
whereassnap.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.Second, when I test installed it with yarn 1.2.1, I noticed that it complained that 0.4.1 was not available:
The resulting
package.json
entry should look like:and
yarn.lock
:Generally, when something weird like this happens, use
yarn add
with the package name manually and see what it does.