Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CORRUPTS NODE_MODULES #27

Open
Arnique opened this issue Oct 7, 2020 · 6 comments
Open

CORRUPTS NODE_MODULES #27

Arnique opened this issue Oct 7, 2020 · 6 comments

Comments

@Arnique
Copy link

Arnique commented Oct 7, 2020

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.

@ghost
Copy link

ghost commented Mar 16, 2021

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?

@devthejo
Copy link

devthejo commented Mar 21, 2021

to fix this, merge this:

{
  "scripts": {
      "postinstall": "link-module-alias",
  }
}

into your package.json file ;)

@Papooch
Copy link

Papooch commented Mar 22, 2021

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.

@devthejo
Copy link

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"
    },
}

@Papooch
Copy link

Papooch commented Mar 22, 2021

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.

@tripathi-abhishek
Copy link

@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.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants