D
D
Dmitry Demin2015-06-12 07:13:38
npm
Dmitry Demin, 2015-06-12 07:13:38

What should I do if a third-party module uses too long names?

Hello. The essence of the problem:
I use a third-party module that works without problems separately (when installed globally), however, when I place this module in the node_modules of my module, a rake appears due to too long paths to files / folders.
Those. my module can no longer just be taken and installed globally, I have to use the
npm link command .
Is there a solution to this situation in the internal mechanisms of npm ?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Demin, 2015-06-14
@keksmen

The problem was solved by copying some modules from the dependencies of the used module into your own dependencies.
package.json

{
  "dependencies": {
    "js-yaml": "^3.3.1",
    "yards-cli": "0.1.5"
  }
}

node_modules/module_name/package.json
{
  "dependencies": {
    "тяжелый-модуль-с-длинными-именами": "0.0.7"
  }
}

package.json
{
  "dependencies": {
    "js-yaml": "^3.3.1",
    "yards-cli": "0.1.5",
    "тяжелый-модуль-с-длинными-именами": "0.0.7"
  }
}

node_modules/module_name/package.json
{
  "dependencies": {
    "тяжелый-модуль-с-длинными-именами": "0.0.7"
  }
}

By observation, it was found out that if some modules from your dependencies and the dependencies of the used module have the same name and version, then npm understands that there is no point in installing it twice, because. the module you are using will be able to use the ported module without problems in the following way:
Although, in fact, the following code will be equivalent and more workable in the current situation:
require('module_name/path/to/file.js');

K
Konstantin Kitmanov, 2015-06-12
@k12th

too long file/folder paths
These are file system problems. Moreover, this particular file system, and I even know which one.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question