projectkudu / kudu

Kudu is the engine behind git/hg deployments, WebJobs, and various other features in Azure Web Sites. It can also run outside of Azure.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

npm install for local shared node modules failed with symlink creation error

nebhagat opened this issue · comments

I am trying to deploy a Node.js web app, as part of that, we perform npm install, which installs a local module (using relative path).
The install operation fails with symlink creation error.

Repro steps.

your project built successfully on your dev machine but failed on Azure? => yes
please write down your build tools and their versions (ie Msbuild 15.1.0.0) => gulp 4.0.2

Project structures.

in order to reproduce your issue at our end we need a simple
source/webapp => actual node project
source/common => common node project consumed by webapp

The log/error given by the failure.

Error: EPERM: operation not permitted, symlink 'D:\local\Temp\zipdeploy\extracted\source\msteams-app-questionly.common' -> 'D:\local\Temp\zipdeploy\extracted\source\msteams-app-questionly\node_modules\msteams-app-questionly.common'
11:18:21 AM nebhagat-test-ARM3: npm ERR!  { [Error: EPERM: operation not permitted, symlink 'D:\local\Temp\zipdeploy\extracted\source\msteams-app-questionly.common' -> 'D:\local\Temp\zipdeploy\extracted\source\msteams-app-questionly\node_modules\msteams-app-questionly.common']
11:18:21 AM nebhagat-test-ARM3: npm ERR!   cause:
11:18:21 AM nebhagat-test-ARM3: npm ERR!    { Error: EPERM: operation not permitted, symlink 'D:\local\Temp\zipdeploy\extracted\source\msteams-app-questionly.common' -> 'D:\local\Temp\zipdeploy\extracted\source\msteams-app-questionly\node_modules\msteams-app-questionly.common'
11:18:21 AM nebhagat-test-ARM3: npm ERR!      errno: -4048,
11:18:21 AM nebhagat-test-ARM3: npm ERR!      code: 'EPERM',
11:18:21 AM nebhagat-test-ARM3: npm ERR!      syscall: 'symlink',
11:18:21 AM nebhagat-test-ARM3: npm ERR!      path:
11:18:21 AM nebhagat-test-ARM3: npm ERR!       'D:\\local\\Temp\\zipdeploy\\extracted\\source\\msteams-app-questionly.common',
11:18:21 AM nebhagat-test-ARM3: npm ERR!      dest:
11:18:21 AM nebhagat-test-ARM3: npm ERR!       'D:\\local\\Temp\\zipdeploy\\extracted\\source\\msteams-app-questionly\\node_modules\\msteams-app-questionly.common' },
11:18:21 AM nebhagat-test-ARM3: npm ERR!   stack:
11:18:21 AM nebhagat-test-ARM3: npm ERR!    'Error: EPERM: operation not permitted, symlink \'D:\\local\\Temp\\zipdeploy\\extracted\\source\\msteams-app-questionly.common\' -> \'D:\\local\\Temp\\zipdeploy\\extracted\\source\\msteams-app-questionly\\node_modules\\msteams-app-questionly.common\'',
11:18:21 AM nebhagat-test-ARM3: npm ERR!   errno: -4048,
11:18:21 AM nebhagat-test-ARM3: npm ERR!   code: 'EPERM',
11:18:21 AM nebhagat-test-ARM3: npm ERR!   syscall: 'symlink',
11:18:21 AM nebhagat-test-ARM3: npm ERR!   path:
11:18:21 AM nebhagat-test-ARM3: npm ERR!    'D:\\local\\Temp\\zipdeploy\\extracted\\source\\msteams-app-questionly.common',
11:18:21 AM nebhagat-test-ARM3: npm ERR!   dest:
11:18:21 AM nebhagat-test-ARM3: npm ERR!    'D:\\local\\Temp\\zipdeploy\\extracted\\source\\msteams-app-questionly\\node_modules\\msteams-app-questionly.common',
11:18:21 AM nebhagat-test-ARM3: npm ERR!   parent: 'askAway' }
11:18:21 AM nebhagat-test-ARM3: npm ERR! 
11:18:21 AM nebhagat-test-ARM3: npm ERR! The operation was rejected by your operating system.
11:18:21 AM nebhagat-test-ARM3: npm ERR! It's possible that the file was already in use (by a text editor or antivirus),
11:18:21 AM nebhagat-test-ARM3: npm ERR! or that you lack permissions to access it.
11:18:21 AM nebhagat-test-ARM3: npm ERR! 
11:18:21 AM nebhagat-test-ARM3: npm ERR! If you believe this might be a permissions issue, please double-check the
11:18:21 AM nebhagat-test-ARM3: npm ERR! permissions of the file and its containing directories, or try running
11:18:21 AM nebhagat-test-ARM3: npm ERR! the command again as root/Administrator (though this is not recommended).

What's the best way to install local modules in case symlinks are not allowed for web apps.

Hi

If the problem persists and is related to running it on Azure App Service, please open a support incident in Azure:
https://learn.microsoft.com/en-us/azure/azure-portal/supportability/how-to-create-azure-support-request

This way we can better track and assist you on this case

Thanks,

Joaquin Vano
Azure App Service