link-module-alias
link-module-alias copied to clipboard
CORRUPTS NODE_MODULES
Every time I add a new package it removes some random module from node_modules and my app breaks.
Can't use this anymore for this reason. Pretty cool though when it works.
Encountered this, too. Upon every new install, it most if not all installed modules (but keeps them in package.json). So after every npm intall some-moudle, I have to run npm install again. The preinstall script does not help as it only triggers before a plain 'install'. Why does this happen?
to fix this, merge this:
{
"scripts": {
"postinstall": "link-module-alias",
}
}
into your package.json file ;)
That does not work for me. I added both the "preinstall" and "postinstall" scripts as per the readme and I am still having the same issues as these other guys. E.g. any time I npm install some-module
or npm uninstall some-module
, it almost purges the "node_modules", while informing me that it had "removed <a metric ton of> packages and audited <a few> packages". The only way to bring them back is to run plain npm install
.
are you using @
as an alias ? If this is the case it could be the reason of your problems, as indicated in the readme.
Otherwise, I don't know, personally this is the way I'm using it and I never had bugs:
{
"_moduleAliases": {
"~": "src",
"~public": "public"
},
}
I am using #
, maybe that causes issues, too? I will try the tilde and report back.
P.S. I tried @
initially, but that nukes the repository irreversiby, even deleting the .git folder. The current issue is more mild.
@Papooch did u try? can you please explain the exact steps to successfully use "link-module-alias"?! I am trying to write an article about it and need confirmation (I know I should do it myself but I am a student and right now I am not doing any project which needs this, so I have to ask someone who is actively using this.)