0

This particular error keeps reappearing when i try creating an application, whenever i would choose css then it keeps throwing this error. I was wondering if anyone has experience on how to remedy this.

`\`taishiarai@Taishis-MacBook-Pro \~ % node -v
v18.15.0
taishiarai@Taishis-MacBook-Pro \~ % ng new my-app
? Would you like to add Angular routing? Yes
? Which stylesheet format would you like to use? CSS
A merge conflicted on path "/my-app/src/app/app.module.ts".
taishiarai@Taishis-MacBook-Pro \~ % ng new my-app  
? Would you like to add Angular routing? No
? Which stylesheet format would you like to use? CSS
CREATE my-app/README.md (1059 bytes)
CREATE my-app/.editorconfig (274 bytes)
CREATE my-app/.gitignore (548 bytes)
CREATE my-app/angular.json (2700 bytes)
CREATE my-app/package.json (1037 bytes)
CREATE my-app/tsconfig.json (901 bytes)
CREATE my-app/tsconfig.app.json (263 bytes)
CREATE my-app/tsconfig.spec.json (273 bytes)
CREATE my-app/.vscode/extensions.json (130 bytes)
CREATE my-app/.vscode/launch.json (474 bytes)
CREATE my-app/.vscode/tasks.json (938 bytes)
CREATE my-app/src/favicon.ico (948 bytes)
CREATE my-app/src/index.html (291 bytes)
CREATE my-app/src/main.ts (214 bytes)
CREATE my-app/src/styles.css (80 bytes)
CREATE my-app/src/assets/.gitkeep (0 bytes)
CREATE my-app/src/app/app.module.ts (314 bytes)
CREATE my-app/src/app/app.component.css (0 bytes)
CREATE my-app/src/app/app.component.html (23083 bytes)
CREATE my-app/src/app/app.component.spec.ts (956 bytes)
CREATE my-app/src/app/app.component.ts (210 bytes)
⠏ Installing packages (npm)...npm ERR! code EACCES
npm ERR! syscall open
npm ERR! path /Users/taishiarai/.npm/\_cacache/tmp/e4cebee0
npm ERR! errno -13
npm ERR!
npm ERR! Your cache folder contains root-owned files, due to a bug in
npm ERR! previous versions of npm which has since been addressed.
npm ERR!
npm ERR! To permanently fix this problem, please run:
npm ERR!   sudo chown -R 501:20 "/Users/taishiarai/.npm"

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/taishiarai/.npm/\_logs/2023-03-11T09_23_08_364Z-debug-0.log

```
✖ Package install failed, see above.
The Schematic workflow failed. See above.
````

I tried uninstalling angular and reinstalling it and as well as the node js thinking this was the root of the problem but yet it keeps happening.

  • 1
    is a EACCES error. Try this: https://stackoverflow.com/questions/47252451/permission-denied-when-installing-npm-modules-in-osx – Flo Mar 11 '23 at 09:39

1 Answers1

0

It must be a bug in previous versions of npm. Write the following code on the console screen:

sudo chown -R 501:20 "/Users/taishiarai/.npm"

I think npm will work fine from now on. You can try reinstalling the packages by doing npm install.

  • I have actually fiddled around ont he web and it instructed me to do this exactly and it worked out just fine! Thank you very much @Eren! – Taishi Arai Mar 13 '23 at 08:23