I am trying to build a react app, but when I execute the command npm -i it gives me the following error:
npm -i
Error: Failed to replace env in config:
Running npm install in an IDE (like WebStorm) was my problem. I added the NPM_TOKEN environment variable to .bash_profile and restarted my Terminal, but not my IDE! The IDE did not pick up the changes to the environment until I restarted it as well.
npm install
.bash_profile