k8s-mastery icon indicating copy to clipboard operation
k8s-mastery copied to clipboard

Errors running npm install (node-gyp) on MacOS

Open kibernick opened this issue 5 years ago • 5 comments

Hi, I'm following along your Kubernetes articles and get an error running npm install https://rinormaloku.com/setting-up-react-application/

npm version: 6.13.1 OS: MacOS

I can send you the npm install log if you like, but after looking at some of the errors, I managed to fix this problem by looking at the quick fix listed here: https://github.com/nodejs/node-gyp/issues/792 (and https://github.com/nodejs/nan/issues/735)

kibernick avatar Nov 25 '19 13:11 kibernick

Hi @kibernick

What was the fix? Should I update the project or the article?

rinormaloku avatar Nov 26 '19 08:11 rinormaloku

The fix was the following, not sure if a MacOS only issue, but would be worthwhile to add to the docs/article:

So a quick solution for all node-gyp issues around some of the packages in which is thrown, is to update all those packages with:

$ npm install -g npm-check-updates
$ npm-check-updates -u
$ npm install

kibernick avatar Nov 26 '19 10:11 kibernick

i deleted the global folder (yarn) and removed deps from its package.json file. And it did the trick

haikyuu avatar Apr 02 '20 23:04 haikyuu

I started deleting packages from my packages.json to find out which package is the culprit. Long story short, it was sass-loader. I've installed a different version and problem was resolved

ramast avatar May 09 '20 18:05 ramast

In case others run into this issue:

npm install -g npm-check-updates failed with a permission denied issue on MacOS. If you get that error, it's likely this: Missing write access for local lib node modules

Once that was fixed, the above commands worked like a charm

The fix was the following, not sure if a MacOS only issue, but would be worthwhile to add to the docs/article:

So a quick solution for all node-gyp issues around some of the packages in which is thrown, is to update all those packages with:

$ npm install -g npm-check-updates
$ npm-check-updates -u
$ npm install

thedanfernandez avatar Dec 26 '20 00:12 thedanfernandez