F
F
Fengol2018-04-21 11:52:04
JavaScript
Fengol, 2018-04-21 11:52:04

How to install npm package under different id?

There is a package that is installed with npm as npm i packagewell as the same package, but from a different author, which is installed as npm i @autor/package.
How to install the second package under the id of the first one? They are absolutely identical, the second is the corrected first, and I don’t want to change to imports in the code until the correction in the original.
I tried to put a link to the github of the corrected version under the original identifier, but it is installed a little wrong. If you install the corrected version via npm, then along the way node_modules/@autor/packagethere will be something like the following content

/lib/index.js
index.js

index.js contains imports lib/index.js
In the repo itself, there githubis only a file index.jscontaining a code identical to lib/index.jsfrom npm, there is no folder libthere. But when I install from the repository using npm, only the one index.jsthat contains the import code is installed lib/index.js, although the folder libdoes not exist.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nicholas, 2018-04-21
@healqq

If you use some kind of build system (webpack, etc.), then it’s probably easier to add alias

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question