-
Notifications
You must be signed in to change notification settings - Fork 3k
[npm3] Install with a symlinked module results in lots of warnings (for no reason) #9999
Comments
Actually I expect npm to ignore anything inside the symlinked folder because it isn't allowed to touch anything inside anyways. So the case is more like this: I have a symlinked module called |
npm v3 has broken a few behaviours that `npm-workspace` relies on. - Peer dependencies: These are no longer installed by default. When `npm-workspace` explicitly adds these, they remain functional. Test have been updated to reflect new behaviour. - Linked dependency flattening ( npm/npm#10343 and npm/npm#10348 and npm/npm#9999 ) npm v3 does not correctly install dependencies that are shared between a package and its sym-linked dependency. ``` A +- B (linked) | +- C +- C ``` Should result in both `A` and `B` getting a copy of `C`, however it results in: ``` A +- B (linked) +- C ``` To work around this, npm-workspace now adds 'dummy' packages for ones it will link, then runs `npm i` then replaces the dummy packages with the real symlinks. This results in a complete and correct install. Due to a change in the way npm checks versions after npm 3, the dummy packages need to be different, so the npm version is read at the start of an install.
+1 what @stefanr said. If a module is symlinked in the |
This is pretty infuriating. Since upgrading to npm3, I'm now getting hundreds of lines of spam when doing any npm operation:
The module in question ( |
I wrapped npm in a filter function to avoid this problem: function npms { #`s` for symlink
npm $@ --color=always 2>&1 | grep -vE 'Module is inside a symlinked module'
} Another helpful utility: function npm-ls-linked-deps {
ls -l node_modules | \
grep ^l | \
awk '{print $9}' | \
sed 's/@//g';
} |
During a
npm install
all modules innode_modules
will be analyzed to build up the ideal dependency tree ... as far as I understand ...But this doesn't make any sense for modules that are symlinked. This is also realized by
npm
and results in a bunch of warn messages:So why analyzing this modules anyway? Wouldn't it make sense to filter these out in an earlier install step. Because besides being unnecessary it also takes a lot of time, depending on the size of the module of course.
The text was updated successfully, but these errors were encountered: