k8s-mastery
k8s-mastery copied to clipboard
Errors running npm install (node-gyp) on MacOS
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)
Hi @kibernick
What was the fix? Should I update the project or the article?
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
i deleted the global folder (yarn) and removed deps from its package.json file. And it did the trick
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
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