balloneij
balloneij

Reputation: 2456

How to install @types from an NPM package that has @ in it's name

I can install this node package

npm install @gamestdio/timer --save

However, when I try to install the types which go along with it

npm install @types/@gamestdio/timer --save

The result is

Invalid package name "@types/": name can only contain URL-friendly characters

Upvotes: 3

Views: 2611

Answers (1)

Thanh Le Hai Hoang
Thanh Le Hai Hoang

Reputation: 1403

You can use yarn

yarn add @types/@gamestdio/timer

or manually add to your package.json:

  "dependencies": {
    "@types/": "gamestdio/timer",
  }

then remove your node_modules folder and run npm install again

Upvotes: 1

Related Questions