I've cloned a repo from an existing Angular project and executed sudo npm install within the project.
All packages were installed so far, but the packet node-sass still causes problems.
After the installation process of sudo npm install is finished I get the following error message:
gyp ERR! configure error gyp ERR! stack Error: EACCES: permission denied, mkdir '/ Users / oek1wa3 / Documents / CODEHAN / management / node_modules / node-sass / build' gyp ERR! System Darwin 18.6.0 gyp ERR! command "/ usr / local / bin / node" "/Users/oek1wa3/Documents/CODEHAN/management/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext = "" --libsass_cflags = "" --libsass_ldflags = "" --libsass_library = " gyp ERR! cwd / Users / oek1wa3 / Documents / CODEHAN / management / node_modules / node-sass gyp ERR! node -v v11.10.0 gyp ERR! node-gyp -v v3.8.0 gyp ERR! not ok
If I try to compile the project also an error appears and displays this message (only a section):
at Object.Module._extensions..js (internal / modules / cjs / loader.js: 749: 10) at Module.load (internal / modules / cjs / loader.js: 630: 32) at tryModuleLoad (internal / modules / cjs / loader.js: 570: 12) at Function.Module._load (internal / modules / cjs / loader.js: 562: 3) at Module.require (internal / modules / cjs / loader.js: 667: 17) at require (internal / modules / cjs / helpers.js: 20: 18) at Object. <anonymous> (/Users/oek1wa3/Documents/CODEHAN/management/node_modules/sass-loader/lib/loader.js:3:14) at Module._compile (internal / modules / cjs / loader.js: 738: 30) ERROR in ./src/app/app.component.scss
I've already tried to delete the node_modules folder and the package-lock.json file and run the installation again. Unfortunately without success. I could not find anything else on the net that fixed this problem.
The package.json contains the following versions of relevant packages:
"node-sass": "^4.7.2",
"sass-loader": "^6.0.5",
"@angular/cli": "^7.3.9",
"@angular/core": "7.2.0",
My current npm version: 6.7.0 | My current node version: v11.10.0
I'm using a MacBook Pro with macOS Mojave version 10.14.5.
How can I fix this problem for my project to compiled again?
npm install node-sasswithout sudo and before run that command change the owner of the folder. link