0
votes

I'm confused that why create-react-app required root account to create project? If I create a project with create-react-app without root aka sudo, it return following error message.

Aborting installation. yarnpkg add --exact react react-dom react-scripts --cwd /Users/user/Documents/Projects/ReactJS/mytest has failed.

If I create a project with root, it was working.

2

2 Answers

1
votes

create-react-app not require root, they need permissions to work with file system. So if you have some other account with this permission, feel free to use it.

1
votes

If you have installed create-react-app globally then only it requires sudo aka root permission because a command line tool needs your permission to make file or changes.

if you have not installed create-react-app globally then it might need the sudo aka root permission to make file or changes.