ggpubr, nloptr packages not getting installed

I'm trying to install the ggpubr package, which is not getting installed because of the "nloptr" package and then when I'm trying to install "nloptr" package on its own, it is throwing a similar error. how do I counter resolve this error? The error log is as follows...

 install.packages("ggpubr")
Installing package into ‘C:/Users/kumar.utkarsh/Documents/R/win-library/3.5’
(as ‘lib’ is unspecified)
Warning in install.packages :
  dependency ‘pbkrtest’ is not available
also installing the dependencies ‘nloptr’, ‘lme4’, ‘car’, ‘rstatix’


  There are binary versions available but the source versions are later:
         binary  source needs_compilation
nloptr  1.2.2.1 1.2.2.2              TRUE
lme4     1.1-23  1.1-26              TRUE
car       3.0-7  3.0-10             FALSE
rstatix   0.4.0   0.6.0             FALSE
ggpubr    0.2.5   0.4.0             FALSE

installing the source packages ‘nloptr’, ‘lme4’, ‘car’, ‘rstatix’, ‘ggpubr’

trying URL 'https://cran.rstudio.com/src/contrib/nloptr_1.2.2.2.tar.gz'
Content type 'application/x-gzip' length 2450931 bytes (2.3 MB)
downloaded 2.3 MB

trying URL 'https://cran.rstudio.com/src/contrib/lme4_1.1-26.tar.gz'
Content type 'application/x-gzip' length 3297635 bytes (3.1 MB)
downloaded 3.1 MB

trying URL 'https://cran.rstudio.com/src/contrib/car_3.0-10.tar.gz'
Content type 'application/x-gzip' length 501293 bytes (489 KB)
downloaded 489 KB

trying URL 'https://cran.rstudio.com/src/contrib/rstatix_0.6.0.tar.gz'
Content type 'application/x-gzip' length 394803 bytes (385 KB)
downloaded 385 KB

trying URL 'https://cran.rstudio.com/src/contrib/ggpubr_0.4.0.tar.gz'
Content type 'application/x-gzip' length 2689307 bytes (2.6 MB)
downloaded 2.6 MB

* installing *source* package 'nloptr' ...
** package 'nloptr' successfully unpacked and MD5 sums checked

   **********************************************
   WARNING: this package has a configure script
         It probably needs manual configuration
   **********************************************


** libs

*** arch - i386
C:/RBuildTools/3.5/mingw_32/bin/g++  -I"C:/Users/KUMAR~1.UTK/DOCUME~1/R/R-35~1.3/include" -DNDEBUG          -O2 -Wall  -mtune=generic -c dummy.cpp -o dummy.o
C:/RBuildTools/3.5/mingw_32/bin/gcc  -I"C:/Users/KUMAR~1.UTK/DOCUME~1/R/R-35~1.3/include" -DNDEBUG       -I"/i386/include"   -O3 -Wall  -std=gnu99 -mtune=generic -c init_nloptr.c -o init_nloptr.o
init_nloptr.c:35:19: fatal error: nlopt.h: No such file or directory
 #include "nlopt.h"
                   ^
compilation terminated.
make: *** [C:/Users/KUMAR~1.UTK/DOCUME~1/R/R-35~1.3/etc/i386/Makeconf:208: init_nloptr.o] Error 1
ERROR: compilation failed for package 'nloptr'
* removing 'C:/Users/kumar.utkarsh/Documents/R/win-library/3.5/nloptr'
In R CMD INSTALL
Warning in install.packages :
  installation of package ‘nloptr’ had non-zero exit status

Version:1.0 StartHTML:0000000107 EndHTML:0000001570 StartFragment:0000000127 EndFragment:0000001552

sessionInfo() 
R version 3.5.3 (2019-03-11) 
Platform: x86_64-w64-mingw32/x64 (64-bit) 
Running under: Windows 10 x64 (build 18363) 

Matrix products: default 

locale: [1] LC_COLLATE=English_India.1252 LC_CTYPE=English_India.1252 LC_MONETARY=English_India.1252 
[4] LC_NUMERIC=C LC_TIME=English_India.1252 

attached base packages: [1] stats graphics grDevices utils datasets methods base 

loaded via a namespace (and not attached): 
[1] compiler_3.5.3 tools_3.5.3 packrat_0.5.0

nloptr is an y interface for the NLopt library, you need to install it in your system first, check the installation instructions.