Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

npm install <folder> fails if preinstall-script has npm uninstall <folder> with npm@3.3.6 #9916

Closed
hacker112 opened this issue Oct 9, 2015 · 2 comments

Comments

@hacker112
Copy link

Problem in version: 3.3.6
Worked fine in version: 2.11.3

When working with servers that should not have direct access to the git-repos we use git-submodules sync them to the servers and use local folders to install them as npm packages. (through "npm install --save path/to/submodule" )

Since installing local submodules is only done once and we need to make sure that the package is refreshed each time "npm install" is run. We added preinstall script like this:

  "scripts": {
    "preinstall": "npm uninstall path/to/submodule"
  }

This works fine npm 2 where it uninstalls the package and then reinstalls it.
In npm 3 it fails to install the package at all when the preinstall script is there.

@nadavsinai
Copy link

I am suffering from this too, we used symlinks to simplify require pathes - with a helper module called slinker the thing is that with shrinkwrap npm will remove any module not found in the npm-shrinkwrap.json recursively - destroying the target of the symlinks
we used to use the preinstall script to remove the symlinks and postinstall to add them
npm 3.3.6 runs preinstall too late - after the clearning of the node_modules.

@npm-robot
Copy link

We're closing this issue as it has gone seven days without activity and without being labeled. If we haven't even labeled in issue in seven days then we're unlikely to ever read it.

If you are still experiencing the issue that led to you opening this or this is a feature request you're still interested in then we encourage you to open a new issue. If this was a support issue, you may be better served by joining package.communty and asking your question there.

For more information about our new issue aging policies and why we've instituted them please see our blog post.

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

No branches or pull requests

3 participants