Issue
When installing the Node agent via the packaged .tgz file on Windows, the install fails and throws a permission denied error.
npm ERR! cause:
npm ERR! { Error: EPERM: operation not permitted, rename 'C:\Tools\juice-shop-12.4.0_node10_win32_x64\juice-shop_12.4.0\node_modules\node_contrast\node_modules\@babel\.template.DELETE\node_modules\@babel' -> 'C:\Tools\juice-shop-12.4.0_node10_win32_x64\juice-shop_12.4.0\node_modules\node_contrast\node_modules\@babel\template\node_modules\@babel'
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'rename',
npm ERR! path:
npm ERR! 'C:\\Tools\\juice-shop-12.4.0_node10_win32_x64\\juice-shop_12.4.0\\node_modules\\node_contrast\\node_modules\\@babel\\.template.DELETE\\node_modules\\@babel',
npm ERR! dest:
npm ERR! 'C:\\Tools\\juice-shop-12.4.0_node10_win32_x64\\juice-shop_12.4.0\\node_modules\\node_contrast\\node_modules\\@babel\\template\\node_modules\\@babel' },
npm ERR! stack:
npm ERR! 'Error: EPERM: operation not permitted, rename \'C:\\Tools\\juice-shop-12.4.0_node10_win32_x64\\juice-shop_12.4.0\\node_modules\\node_contrast\\node_modules\\@babel\\.template.DELETE\\node_modules\\@babel\' -> \'C:\\Tools\\juice-shop-12.4.0_node10_win32_x64\\juice-shop_12.4.0\\node_modules\\node_contrast\\node_modules\\@babel\\template\\node_modules\\@babel\'',
Cause
npm
is not installed globally for Windows.
Resolution
Install npm
globally on the machine:
npm install -g npm@latest