Monday, 8 May 2017

npm install doesn't create node_modules dir

I have a node js application. In package.json I inserted the dependences, but when I execute 'npm install' the node_modules dir has a strange structure:

the dependences of my dependency are installed in the node_modules of my application. An example. Consider this dependency graph

foo
-- a
+-- b
   -- c
   +-- d
      -- e
      -- f
         -- g

I expected this folder structure:

foo
 +--node_modules
             -- a
             -- b
                +--node_modules
                           -- c
                           +-- d
                              +--node_modules
                                          -- e
                                          -- f
                                          +--node_modules
                                                      -- g

Instead all modules are installed in

foo
 +--node_modules
          -- a
          -- b
          -- c
          -- d
          -- e
          -- f
          -- g



via Pasquale Marinaro

No comments:

Post a Comment