Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Brew install node --without-npm fails

Following John Papa's post on 'How to use npm global without sudo on OSX' and I am running

brew install node --without-npm

I get this info/error(s):

/usr/local > brew install node --without-npm
==> Downloading https://nodejs.org/dist/v5.10.1/node-v5.10.1.tar.xz
Already downloaded: /Library/Caches/Homebrew/node-5.10.1.tar.xz
==> Downloading https://ssl.icu-project.org/files/icu4c/56.1/icu4c-56_1-src.tgz
Already downloaded: /Library/Caches/Homebrew/node--icu4c-56.1.tgz
==> ./configure --prefix=/usr/local/Cellar/node/5.10.1 --without-npm --with-intl
==> make install
Last 15 lines from /Users/justin/Library/Logs/Homebrew/node/02.make:
#include <limits>
         ^
In file included from ../deps/gtest/src/gtest-death-test.cc:34:
In file included from ../deps/gtest/include/gtest/gtest-death-test.h:41:
In file included from ../deps/gtest/include/gtest/internal/gtest-death-test-internal.h:40:
In file included from ../deps/gtest/include/gtest/internal/gtest-internal.h:40:
../deps/gtest/include/gtest/internal/gtest-port.h:259:10: fatal error: 'ctype.h' file not found
#include <ctype.h>   // for isspace, etc
         ^
1 error generated.
make[1]: *** [/private/tmp/node20160410-11435-157r8bn/node-v5.10.1/out/Release/obj.target/gtest/deps/gtest/src/gtest-filepath.o] Error 1
make[1]: *** Waiting for unfinished jobs....
1 error generated.
make[1]: *** [/private/tmp/node20160410-11435-157r8bn/node-v5.10.1/out/Release/obj.target/gtest/deps/gtest/src/gtest-death-test.o] Error 1
make: *** [node] Error 2

Following Homebrew's troubleshooting instructions, I ran brew update twice and brew doctor -- but still no luck. I'm not familiar with homebrew and haven't messed with this stuff in a while. Any ideas what these errors mean?

like image 690
Justin L. Avatar asked Apr 10 '16 22:04

Justin L.


People also ask

Can you install node without npm?

We can install modules required for a particular project in node. js without npm, the recommended node package manager using yarn.

Why is npm install failing?

The error in NPM, 'error package install failed, see above', can occur when the user creates a new project in Angular using Node. js using VS code. This means that NPM is corrupted in your system, and must reinstall NPM.

Does installing node install npm?

NPM is included with Node. js installation. After you install Node. js, verify NPM installation by writing the following command in terminal or command prompt.

How do I fix npm not found on Mac?

in the case of mac os with homebrew.. two steps to do is to (1) which node (2) which npm which should be both in /usr/local/bin (where homebrew installs/symlinks node+npm)... to resolve.. try (1) brew doctor (2) brew reinstall node if its still giving issues.. check your path (echo $PATH).


1 Answers

It seems you did not install command line developer tools. Before installing Node with Homebrew, try executing this command in your Terminal:

xcode-select --install

If it is installed successfully this message will be shown:

xcode-select: error: command line tools are already installed, use "Software Update" to install updates

After the installation, run the brew command again.

The ctype.h file should be somewhere like /usr/include/ctype.h.

like image 150
Hamid Rouhani Avatar answered Oct 12 '22 17:10

Hamid Rouhani