Hello I am currently trying to get React library. Node.js is installed on my computer currently. When I enter the code npx create-react-app project-name to get react, it doesn’t work. I get the following:
C:UsersPaul>npx create-react-app my-app
npm ERR! code ENOENT
npm ERR! syscall lstat
npm ERR! path C:UsersPaulAppDataRoamingnpm
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, lstat ‘C:UsersPaulAppDataRoamingnpm’
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in: C:UsersPaulAppDataLocalnpm-cache_logs2024-07-21T00_42_34_317Z-debug-0.log
I looked around online but couldn’t find an answer, and I made sure Node.js was installed.
2
Answers
Try to adjust the policies, let’s first open Windows PowerShell with administrative privileges.
Open Windows PowerShell by right-clicking and selecting "Run as Administrator".
Next, execute the following command to adjust the policies: Set-ExecutionPolicy Unrestricted
After completing the above steps, we can proceed to add Node.js to the environment variables path. Remember, even if these steps don’t work initially, you’ll still need to follow them.
This happens when we don’t add the path of node.js to environment variables. See one video on youtube and add it.