Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

node failed to build on 10.10 #33484

Closed
abcsds opened this issue Oct 22, 2014 · 33 comments
Closed

node failed to build on 10.10 #33484

abcsds opened this issue Oct 22, 2014 · 33 comments
Labels

Comments

@abcsds
Copy link

abcsds commented Oct 22, 2014

brew install node throws warning when making npm:
npm ERR! Additional logging details can be found in:
npm ERR! /usr/local/lib/node_modules/npm/npm-debug.log
npm ERR! not ok code 0
make[1]: *** [node_modules/.bin/ronn] Error 3
make: *** [man/man3/npm-bin.3] Error 2

Warning: The post-install step did not complete successfully
You can try again using 'brew postinstall node'

After command brew postinstall node it throws the same npm building error message and points towards troubleshooting gitpage.
Following instructions there I've updated Xcode and CLT, and searched for open tickets on node and npm. I found nothing.

The problem: npm doesn't build. There are binaries, but when running it shows activity, but does nothing.
The gist-log is the following:
https://gist.github.com/abcsds/6082952c83a166ca0f06

@listenaddress
Copy link

I'm having the same problem today.

I was able to fix these:
make[1]: *** [node_modules/.bin/ronn] Error 3
make: *** [man/man3/npm-bin.3] Error 2
by uninstalling node and running rm -r /Users/abcsds/.npm/ before installing again.

but I'm still getting
==> make install
==> /usr/local/bin/npm install --global npm@latest --prefix /usr/local
--global
npm@latest
--prefix
/usr/local

Warning: The post-install step did not complete successfully
You can try again using 'brew postinstall node'

@DomT4
Copy link
Member

DomT4 commented Oct 22, 2014

Try murdering your Node install and then doing brew install -v node. Note: You will lose absolutely every module you've installed with npm. Don't do this if you're hoping to keep them.

@listenaddress
Copy link

Hmm I'm still getting this at the end
==> /usr/local/bin/npm install --global npm@latest --prefix /usr/local
Failed to execute: /usr/local/bin/npm
Warning: The post-install step did not complete successfully
You can try again using brew postinstall node

@abcsds
Copy link
Author

abcsds commented Oct 22, 2014

I am actually doing a clean install.

@thomchop
Copy link

Removing node, npm, and all modules before doing a clean install with homebrew worked for me.
For some reason I did have to recreate the /usr/local/lib/dtrace directory.

I removed files in the following locations:
/usr/local/lib/node
/usr/local/include/node
/usr/local/lib/dtrace/node.d
/usr/local/share/man/man1/node.1
/usr/local/bin/npm
~/.npm (deleting this will erase your config)

@abcsds
Copy link
Author

abcsds commented Oct 22, 2014

It works. I had formatted my hard drive to clean install Yosemite, but did copy the ~/.npm folder to my home folder. Erasing it solved the problem.

@DomT4
Copy link
Member

DomT4 commented Oct 23, 2014

Is everyone here successfully building now, or is anyone still having trouble with Node?

@MikeMcQuaid
Copy link
Member

@DomT4 I'm wondering why NPM_CONFIG_USERCONFIG doesn't seem to be fixing this.

@rkz
Copy link

rkz commented Oct 23, 2014

On Yosemite (upgraded from Mavericks), I was able to murder my node as @DomT4 suggested but I'm getting the following when running brew postinstall node:

scripts/doc-build.sh doc/api/npm-bin.md man/man3/npm-bin.3
node cli.js install ronn --no-global
bash: node: command not found
make[1]: *** [node_modules/.bin/ronn] Error 127
make: *** [man/man3/npm-bin.3] Error 2

However after running brew install node, I am able to run the node command. I don't get the reason for bash: node: command not found.

@MikeMcQuaid
Copy link
Member

@rkz Try brew reinstall node

@rkz
Copy link

rkz commented Oct 23, 2014

@MikeMcQuaid Same.

@DomT4
Copy link
Member

DomT4 commented Oct 23, 2014

If it wasn't for the sudo issue I'd suggest Homebrew give up on Node and suggest people use the upstream binary instead. Can everyone still having issues create a brew gist-logs node please?

@listenaddress
Copy link

I'm clean installing Mavericks, so I should be good.

@rkz
Copy link

rkz commented Oct 25, 2014

Turns out I was able to finish the install by adding /usr/local/bin (where the node executable is located) to my .bash_profile. For some reason it was included in zsh's PATH but not bash's.

@markchagers
Copy link

I had the same problem and solved it by following @DomT4's suggestion. After that I reinstalled gulp, http-server and yeoman:
npm install -g gulp http-server yo
However this seems to have installed a whole lot of modules as well, npm list -g > npm_global.txt produces a 600+ line file. Is this normal?

@thomchop
Copy link

That command will print all the versions of packages that are installed, as well as their dependencies, in a tree-structure. That's probably why there's more modules listed than you're expecting.
If you want to list only the modules you directly installed, use npm ls -g --depth=0.
Usually I only want to see my immediate dependencies, so I added that flag (depth=0) to my .npmrc file.

@damnhandy
Copy link

I had the same issue but it seems that the core problem is that it failed when it was trying to create a symlink for dtrace:

The formula built, but is not symlinked into /usr/local
Could not symlink lib/dtrace/node.d
/usr/local/lib/dtrace is not writable.

You can try again using:
brew link node
==> make uninstall
uninstall

node cli.js rm npm -g -f
bash: node: command not found
make: *** [uninstall] Error 127 
Warning: The post-install step did not complete successfully

I ran brew link node and then brew postinstall node and it worked. Just to be sure, I completely uninstalled node using brew uninstall node and then reinstalled. On re-installation, I had zero issues. This makes me think that this some left over permission issues from my pre-Yosemite upgrade. Right now, node seems to be working fine with Homebrew.

@DomT4
Copy link
Member

DomT4 commented Nov 9, 2014

dtrace is one of those directories that crops up quite often as a little hellraiser. It can usually be fixed with sudo chown whoami /usr/local/lib/dtrace or if that doesn't work, you can just remove that directory safely with sudo rm -rf /usr/local/lib/dtrace and then post-install Node again. Glad you managed to resolve your issue relatively easily though 👍

@damnhandy
Copy link

I should also note that when I uninstalled node using brew uninstall node, it removed this directory anyway. The only thing present in that directory was node.d. If your goal is installing or reinstalling nodejs, it seems safe to wipe the directory.

@nickthedude
Copy link

DomT4's comment worked for me (running the shell script and then reinstalling through brew)

@DomT4
Copy link
Member

DomT4 commented Nov 18, 2014

@thomchop I missed your post above before, but thanks for the reminder about npm's love of trees. I've pushed a new commit to my script to ensure people aren't getting enormous readouts on that.

Glad the script is still useful. Node ❤️ root permissions when it installs through the .pkg, so any traces on a system of that tend to cause hell given Brew deliberately isn't run as root and can't override those.

@bdougie
Copy link

bdougie commented Nov 21, 2014

@DomT4 I am having this issue and use every solution provided here except your script. How does one go about running your script in the terminal?

@bdougie
Copy link

bdougie commented Nov 21, 2014

Nevermind, I got it:
sh terminatenode.sh in case anyone else has that quesiton

@DomT4
Copy link
Member

DomT4 commented Nov 21, 2014

@brianllamar Apologies, I did leave a hint on how to make the script executable on the page, but I didn't hint as to how to actually execute it. I'll push a fix for that clarification shortly.

As you discovered you can either do sh terminatenode.sh or if you're cd-ed into the same folder as the script you can do ./terminatenode.sh.

@cgfeel
Copy link

cgfeel commented Nov 23, 2014

sudo chown -R `whoami` /usr/local/lib/node_modules
sudo chown -R `whoami` ~/.npm
brew postinstall node

@swells808
Copy link

No matter what I do I always get hung up at this step:

$ brew postinstall node
==> make uninstall
uninstall

node cli.js rm npm -g -f
bash: node: command not found
make: *** [uninstall] Error 127

@DomT4
Copy link
Member

DomT4 commented Dec 10, 2014

@swells808 Either kill Node entirely and try again, or do brew gist-logs node and post the link below.

@swells808
Copy link

Tried to kill it. Here is the link https://gist.github.com/5a34b780b4ffe077da11

@DomT4
Copy link
Member

DomT4 commented Dec 10, 2014

Try brew remove node && sudo rm -rf /usr/local/include/node/ && brew install -v node.

@swells808
Copy link

and again:

rmdir /usr/local/include
Error: The brew link step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink share/man/man1/node.1
Target /usr/local/share/man/man1/node.1
already exists. You may want to remove it:
rm /usr/local/share/man/man1/node.1

To force the link and overwrite all conflicting files:
brew link --overwrite node

To list all files that would be deleted:
brew link --overwrite --dry-run node

Possible conflicting files are:
/usr/local/share/man/man1/node.1
/usr/local/lib/dtrace/node.d
==> make uninstall
node cli.js rm npm -g -f
bash: node: command not found
make: *** [uninstall] Error 127
Warning: The post-install step did not complete successfully
You can try again using brew postinstall node
==> Summary
🍺 /usr/local/Cellar/node/0.10.33_1: 2080 files, 28M

@DomT4
Copy link
Member

DomT4 commented Dec 10, 2014

Are you sure you tried the script? Those directories would be gone with the script. Try:

curl -O https://raw.githubusercontent.com/DomT4/scripts/master/OSX_Node_Removal/terminatenode.sh && chmod +x terminatenode.sh && ./terminatenode.sh

@jacknagel
Copy link
Contributor

Is there a primary issue still being tracked here, or are people just posting random failures?

@DomT4
Copy link
Member

DomT4 commented Dec 19, 2014

Nope. It's Sgt. Pepper's Not-So-Lonely Random Node Failures Club Band. Can probably be closed, if so desired.

@Homebrew Homebrew locked and limited conversation to collaborators Feb 17, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests