'Can´t Fix NPM EACCESS issue

i want to start a new Ionic Project an get this issue:

➜  ~ sudo ionic start AppName blank --type ionic1
Password:
...

> npm i
npm WARN deprecated [email protected]: This module relies on Node.js's internals and will break at some point. Do not use it, and update to [email protected].
npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated [email protected]: this library is no longer supported
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated [email protected]: please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js
npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated [email protected]: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
npm WARN deprecated [email protected]: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5
npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.
npm ERR! code 1
npm ERR! path /Users/jonasromankiewicz/AppName/node_modules/node-sass
npm ERR! command failed
npm ERR! command sh -c node scripts/install.js
npm ERR! shell-init: error retrieving current directory: getcwd: cannot access parent directories: Permission denied
npm ERR! node:internal/bootstrap/switches/does_own_process_state:126
npm ERR!     cachedCwd = rawMethods.cwd();
npm ERR!                            ^
npm ERR!
npm ERR! Error: EACCES: permission denied, uv_cwd
npm ERR!     at process.wrappedCwd [as cwd] (node:internal/bootstrap/switches/does_own_process_state:126:28)
npm ERR!     at node:path:1082:24
npm ERR!     at Object.resolve (node:path:1096:39)
npm ERR!     at resolveMainPath (node:internal/modules/run_main:19:40)
npm ERR!     at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:71:24)
npm ERR!     at node:internal/main/run_main_module:17:47 {
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'uv_cwd'
npm ERR! }

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/jonasromankiewicz/.npm/_logs/2022-05-04T14_24_14_225Z-debug-0.log
[ERROR] An error occurred while running subprocess npm.

        npm i exited with exit code 1.

        Re-running this command with the --verbose flag may provide more
        information.

I tried all the solutions on Stack Overflow and the solution on NPM but this didnt help.

I have the Mac M1 Pro and MacOS Monterey



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source