R throws an error when I use the below code to load library data.table to the cpu cluster. But data.table package is installed on R and it's working fine when used outside parallel code.
no_cores <- detectCores() - 1
cl <- makeCluster(no_cores,outfile="out.txt")
clusterEvalQ(cl, library(data.table))
Error :-
clusterEvalQ(cl, library(data.table)) Error in checkForRemoteErrors(lapply(cl, recvResult)) : 3 nodes produced errors; first error: there is no package called 'data.table'
Building on what HenrikB said above in the comments, I got rid of this problem by adding my .libPaths() call to clusterEvalQ():