Nodejs plugin - can not rebuild npm via launchpad

gyp ERR! clean error
gyp ERR! stack Error: EACCES: permission denied, rmdir 'build'

This happens, only when I use the prepare scriptlet to upgrade my npm

Sometimes, npm needs a rebuild of all its compilers to avoid errors like

Error: The module '/snap/snappy-app/x1/usr/share/snappy-app/resources/app/node_modules/nslog/build/Release/nslog.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 48. This version of Node.js requires
NODE_MODULE_VERSION 53. Please try re-compiling or re-installing


Using the nodejs plugin, I do not see any option to do a rebuild , before the plugin

expressly finds the package.json and installs every thing.

I can use the prepare block, and it works on my local station,

but what about CI's or auto builds via launchpad?

I do not control permissions on the build time host! Hence, an npm rebuild fails
and hence the build itself fails.

Can snapcraft provide for a provision where,

npm update

can be run before the plugin installs everything in package.json?