I’ve got a project which defines a local dependency via
link:../localpackage/ in the
package.json file and a
webpack. The local package
localpackage has a peer dependency on
webpack but does not define any
npm install in the project, it creates a symlink to
localpackage in the
node_modules directory and it also installs
webpack into the
Yet, when executing
npm start in the project, which runs a script, which uses
localpackage, I get the following error:
Error: Cannot find module 'webpack' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15) at Function.Module._load (internal/modules/cjs/loader.js:508:25) at Module.require (internal/modules/cjs/loader.js:637:17) ...
Why can’t it find the
webpack package although it’s properly installed? Does that mean local packages can not resolve peer dependencies within a project due to the symlink it creates for linking the local package? Or is this a bug?
I’m running Window 10 using Node
10.15.3 and npm
Thanks a lot, I really appreciate your help on this!