I was going about business as usual and about to checkout generator-angular-fullstack.
I got no red errors but a message at the end saying Error: Cannot find module 'child-process-close'
. I tried many a-thing–uninstalling node, reinstalling, manually getting rid of files and directories in local and/or global paths and tried to make sure Homebrew was the one who installed everything and somehow I've made things worse.
(Also, I initially saw errors regarding karma. Everything looked right but it doesn't seem I did any good by throwing commands at it.)
I am at a loss. All the stackoverflow questions have been clicked and I'm afraid I've probably tried too many of the suggestions. I cannot install any Yeoman generator. I cannot install anything with npm. When inside the project directory when I run npm install it throws the error. I really have no clue. Is there a way I can basically start over all together? A simple uninstall and install isn't cutting it. Something in the system needs to change but I don't know what. Any ideas?
I don't have a thorough list of how I ended up getting Node back in working order, but this Homebrew issue was really informative & helpful. I don't know how my permissions got out of whack, it was likely my own fault. This didn't fix everything though, I was still getting child-process-close errors. Looking through issues on NPM's github, I found this, which tells how to manually remove package.tgz. The short is run rm /Users/tylersloan/.npm/connect/2.8.8/package.tgz
. Viola!
You’ll want to remove the node_modules
folder using this command:
$ rm -rf /usr/local/lib/node_modules
Then re-install node
:
$ brew uninstall node
$ brew install node
That brings npm
back to life.
On my machine, I had to make a couple of adjustments to @Believe2014 's response
$ rm -rf /usr/local/lib/node_modules
And then reinstall node as sudo
$ brew uninstall node
$ sudo brew install node
Then npm
behaved as expected for me, for example to install the Sails framework:
sudo npm install -g sails
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With