I have a package which resides in a subfolder of another package (or anywhere locally), and the parent package now needs to install it:
main
├──node_modules
├──otherProject
│ ├──node_modules
│ ├──index.js
│ └──package.json
├──package.json
└──something.anything
The files (apart from node_modules
and other common items) are from version control. Is there a way to do this on windows 7/8/10 without elevated permissions, that works "out of the box"?
On linux this would be a simple npm install ./otherProject
.
While not too relevant, i'll add that this is a custom eslint plugin. Maybe someone has a tip that solves the specific situation, but isn't generalizable.
A short summary of the issues:
To create symlinks on windows, the process needs administrator permissions, or developer mode on windows 10. I'd not count either as "out of the box", a build needing administrator or special OS-flags is a non-solution. This means neither
npm install <folder>
nornpm link
work, as both create symlinks.An alternative is creating a tarball, and installing that. First of all, this introduces an unnecessary copy, which complicates making changes to the package. Secondly, this tarball needs to be created, before installation, but
preinstall
for mythical reasons is still not done first. Updating fails, as it tries to resolve the file, beforepreinstall
generated it.
I don't see any of the solutions in e.g. this question to apply. This answer helped with the tarball approach, which is also now stuck. I hope i am just misunderstanding something, or making a simple mistake.