Trying to install npm create-react-app

Currently trying to install create-react-app, i typed ‘npm install -g create-react-app’ into my MacOS terminal, and have received various errors.

2418 verbose stack Error: EACCES: permission denied, symlink ‘…/lib/node_modules/create-react-app/index.js’ -> ‘/usr/local/bin/create-react-app’
2419 verbose cwd /Users/tomleach
2420 verbose Darwin 19.0.0
2421 verbose argv “/usr/local/bin/node” “/usr/local/bin/npm” “install” “-g” “create-react-app”
2422 verbose node v12.16.2
2423 verbose npm v6.14.4
2424 error code EACCES
2425 error syscall symlink
2426 error path …/lib/node_modules/create-react-app/index.js
2427 error dest /usr/local/bin/create-react-app
2428 error errno -13
2429 error Error: EACCES: permission denied, symlink ‘…/lib/node_modules/create-react-app/index.js’ -> ‘/usr/local/bin/create-react-app’
2429 error [OperationalError: EACCES: permission denied, symlink ‘…/lib/node_modules/create-react-app/index.js’ -> ‘/usr/local/bin/create-react-app’] {
2429 error cause: [Error: EACCES: permission denied, symlink ‘…/lib/node_modules/create-react-app/index.js’ -> ‘/usr/local/bin/create-react-app’] {
2429 error errno: -13,
2429 error code: ‘EACCES’,
2429 error syscall: ‘symlink’,
2429 error path: ‘…/lib/node_modules/create-react-app/index.js’,
2429 error dest: ‘/usr/local/bin/create-react-app’
2429 error },
2429 error stack: “Error: EACCES: permission denied, symlink ‘…/lib/node_modules/create-react-app/index.js’ -> ‘/usr/local/bin/create-react-app’”,
2429 error errno: -13,
2429 error code: ‘EACCES’,
2429 error syscall: ‘symlink’,
2429 error path: ‘…/lib/node_modules/create-react-app/index.js’,
2429 error dest: ‘/usr/local/bin/create-react-app’
2429 error }
2430 error The operation was rejected by your operating system.
2430 error It is likely you do not have the permissions to access this file as the current user
2430 error
2430 error If you believe this might be a permissions issue, please double-check the
2430 error permissions of the file and its containing directories, or try running
2430 error the command again as root/Administrator.
2431 verbose exit [ -13, true ]

I’ve tried to uninstall and delete the node and node_modules directories as I read on stackpost and then re-installed the LTS.pkg again, although I’ve read that this can be something to do with using a .pkg file on a mac and I need to use sudo?

Would really appreciate any help that someone can offer :slight_smile:

1 Like

I solved this by simply running:

sudo npm install -g create-react-app

and adding in my password.

3 Likes