Search code examples
node.jsnpmnpm-link

npm link, without linking devDependencies


It appears that when I run npm link, it will install the project globally, and it seems to install devDependencies with it.

Is there a way to run npm link without devDependencies, perhaps with the --only=production flag?


Solution

  • In [email protected] or lower

    When you run npm link in other_module then you will get both dependencies and devDependencies symlinked.

    The --production flag doesn't change anything, still creates a symlink to the whole directory

    In [email protected]

    They fixed it!

    If you remove node_modules and then do npm link --only=production, it runs an install before symlinking, and therefore devDependencies folder are indeed excluded.