You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a local module that is referenced by path in my application's package.json, e.g:
"co-main": "file:../CompanyModules/base/co-main/"
That co-main module depends on another company module that is reside an other directory. So in co-main's package.json has this:
"co-utils": "file:../co-utils"
So, for the better understanding, the directory structure is the following:
C:
|- Dev
|- MyCoolApplication (co-main referenced there)
|- CompanyModules
|- base
|- co-main (here lies co-main that references utils with file:../co-utils)
|- co-utils
npm install runs fine, but yarn install fails with the following:
error "C:\\Dev\\co-utils" doesn't exist.
So the bug is obvious, yarn resolves co-main's relative path by using the main package.json's path (C:\Dev\MyCoolApplication), but npm uses the submodule's root path for relative resolution (C:\Dev\CompanyModules\base\co-main).
If the current behavior is a bug, please provide the steps to reproduce.
Create an environment described above
Run npm install, it gets succeeded
Run yarn install, it gets failed with the above error
What is the expected behavior?
yarn resolves relative paths exactly like npm does.
Please mention your node.js, yarn and operating system version.
Windows 10, Node.js 4.6.0, yarn 0.15.1, npm 3.10.5
The text was updated successfully, but these errors were encountered:
seems like the file resolver always resolves relative to cwd when the module path is not absolute. what it should do is resolve relative to the parent package (recursively).
Do you want to request a feature or report a bug?
bug
What is the current behavior?
I have a local module that is referenced by path in my application's package.json, e.g:
That
co-main
module depends on another company module that is reside an other directory. So inco-main
's package.json has this:So, for the better understanding, the directory structure is the following:
npm install
runs fine, butyarn install
fails with the following:So the bug is obvious, yarn resolves co-main's relative path by using the main package.json's path (C:\Dev\MyCoolApplication), but npm uses the submodule's root path for relative resolution (C:\Dev\CompanyModules\base\co-main).
If the current behavior is a bug, please provide the steps to reproduce.
npm install
, it gets succeededyarn install
, it gets failed with the above errorWhat is the expected behavior?
yarn resolves relative paths exactly like npm does.
Please mention your node.js, yarn and operating system version.
Windows 10, Node.js 4.6.0, yarn 0.15.1, npm 3.10.5
The text was updated successfully, but these errors were encountered: