5

I am trying to install marktext globally using npm (after cloning the repository):

npm install -g

npm WARN dagre-d3-renderer@0.5.8 requires a peer of d3@^4.13.0 but none is installed. You must install peer dependencies yourself.

How should I install, the peer dependency for the global package? Please give the command so that it is safe and prevents future conflicts.


I did npm install -g d3@^4.13.0 but I still get the same error.

Is this a good idea to install the dependency globally? Also, do I need to lock this at the version globally to prevent auto update when I do global update?

Zach
  • 539
  • 1
  • 4
  • 22
Porcupine
  • 5,885
  • 2
  • 19
  • 28

1 Answers1

0

Try it with upgrading npm to version 7

npm install -g npm@7

npm 7 comes with new features. One of them is the automatically installing peer dependencies.

Automatically installing peer dependencies: prior to npm 7 developers needed to manage and install their own peer dependencies. The new peer dependency algorithm ensures that a validly matching peer dependency is found at or above the peer-dependent’s location in the node_modules tree.

SwissCodeMen
  • 4,222
  • 8
  • 24
  • 34