solveing method:
fixed the issue by adding -g flag to the installation command.
use command:
npm i optimize-css-assets-webpack-plugin -g -D