-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
tools: add preinstall script for npm on OS X #3986
Conversation
Notes: I couldn't reproduce the original anymore, so I don't know how we can confirm this will actually work? |
Good point. I'll see if I can spin up a vm and try to reproduce |
# TODO Can this be done inside the .pmdoc? | ||
# TODO Can we extract $PREFIX from the installer? | ||
cd /usr/local/bin | ||
rm -rf ../lib/node_modules/npm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are we doing a cd
followed by rm
and not rm
with absolute path?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wow, good question. That is how the postinstall script is done. And now that I look again, it was done that way for a reason. Updating now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we also need a set -e
if we're doing multiple lines, if the cd
fails then the rm
will still execute
Make sure we cleanly remove npm before installing on OS X
Ok, updated with absolute path and |
test build of this created @ https://nodejs.org/download/test/v6.0.0-test201512088ac2af7628/ if anyone else wants to review the changes |
I
So something's not right with this as far as I can tell. |
Perhaps it needs to be "preupgrade" as well as "preinstall". Reading here http://s.sudre.free.fr/Stuff/PackageMaker_Howto.html but I don't know how authoritative this is. |
@rvagg Ok yes it looks like neither the preinstall, nor the postinstall scripts were running. What is weird to me is that the |
@evanlucas I think the other issue mostly needs review. |
Closing. Hopefully we can get the new OS X pkg stuff in soon. It should replace this anyways |
Make sure we cleanly remove npm before installing on OS X
Related: #3606
This is working for me locally, but would be great to have some others test.