How do I update java to work with 1.12.2 on freenas?

So i followed a few instructions like:
pkg install -y npm openjdk8
sed -i ‘’ -e ‘s|^(command=").(")$|\1/usr/local/bin/node\2|’ /usr/local/etc/rc.d/mineos
sed -i ‘’ -e 's|^(start_precmd=").
(")$|\1export PATH=$PATH:/usr/local/bin:/usr/pbi/mineos-amd64/bin\2|’ /usr/local/etc/rc.d/mineos
sed -i ‘’ -e ‘s|^([[:space:]])/./npm([[:space:]].*)$|\1CXX=c++ /usr/local/bin/npm\2|’ /usr/local/etc/rc.d/mineos
service mineos onestop
service mineos oneupdate
service mineos start

But on the oneupdate part i get a lot of npm errors and i dont know what to do.