Yarn: Yarn install error on Azure App Service

Created on 31 Oct 2018  路  8Comments  路  Source: yarnpkg/yarn


Using yarn version 1.12.1 on Azure App Service errors during installation.

What is the current behavior?
Error during installation of dependencies

00:06:35.319 remote: Selected node.js version 8.11.1. Use package.json file to choose a different version.
00:06:35.319 remote: Selected npm version 5.6.0
00:06:35.320 remote: Updating iisnode.yml at D:\home\site\wwwroot\iisnode.yml
00:06:35.320 remote: Verifying Yarn Install.
00:06:37.221 remote: D:\local\AppData\npm\yarnpkg -> D:\local\AppData\npm\node_modules\yarn\bin\yarn.js
00:06:37.221 remote: D:\local\AppData\npm\yarn -> D:\local\AppData\npm\node_modules\yarn\bin\yarn.js
00:06:37.221 remote: + [email protected]
00:06:37.221 remote: added 1 package in 0.89s
00:06:37.221 remote: Installing Yarn Packages.
00:06:37.786 remote: yarn install v1.12.1
00:06:38.722 remote: [1/5] Validating package.json...
00:06:38.722 remote: [2/5] Resolving packages...
00:06:39.289 remote: [3/5] Fetching packages...
00:06:39.856 remote: info If you think this is a bug, please open a bug report with the information provided in "D:\\home\\site\\wwwroot\\yarn-error.log".
00:06:39.857 remote: error An unexpected error occurred: "EPERM: operation not permitted, symlink 'D:\\local\\LocalAppData\\Yarn\\Cache\\v3\\npm-esprima-4.0.0-4499eddcd1110e0b218bacf2fa7f7f59f55ca804\\node_modules\\esprima\\bin\\esparse.js' -> 'D:\\local\\LocalAppData\\Yarn\\Cache\\v3\\npm-esprima-4.0.0-4499eddcd1110e0b218bacf2fa7f7f59f55ca804\\node_modules\\esprima\\.bin\\esparse'".

Yarn error log attached for more info.
yarn-error.log

What is the expected behavior?
Correct installation

Please mention your node.js, yarn and operating system version.
Node: 8.11.1
Yarn: 1.12.1
OS: Windows

triaged

Most helpful comment

@arcanis Following your suggestion, using cmdshim seems to overcome this problem. Tested on actual Azure Web App Services deployment on a reasonably sized project.
node: v8.11.1

All 8 comments

Same issue for me detailed here: https://stackoverflow.com/questions/53078508/yarn-eperm-operation-not-permitted-on-symlink-on-azure-app-service

It seems that any version after 1.10.0 doesn't work with those symlink errors. The strange thing is that those

This error does not repro on Windows 10 outside of the Azure sandbox env - We need to assume this is a conflict with the Azure sandbox. Did anyone open an issue over on Azure / Kudu?

@yoadsn as far as I could tell it's a Windows Server 2016 environment - if you could try that in the meantime. I'll see about opening an issue there and linking back.

My theory is that the symlinks created here don't work on all Windows versions (iirc, symlink creation required elevated privileges in older Windows versions, which would be consistent with the EPERM error).

If you can reproduce the issue somewhere, can you try making a PR to replace the symlink creation with cmdShim? Cf how we do it here: https://github.com/yarnpkg/yarn/blob/master/src/package-linker.js#L33-L46

@arcanis if you are referring to me, I am happy to edit the code directly on git but I wouldn't know how to compile yarn to test it.

Secondly, I'm not sure if there is a relevant repository for Azure App Service host, or at least I couldn't find one...

Compiling yarn for dev should just be a matter of yarn && yarn build. You'll then be able to use ./bin/yarn instead of your own and see whether it works.

For "production" use (that you can then push to the system that fails in order to test it there), you can run yarn && yarn build-bundle instead, which will generate a single-file Yarn inside the artifacts folder 馃檪

@arcanis Following your suggestion, using cmdshim seems to overcome this problem. Tested on actual Azure Web App Services deployment on a reasonably sized project.
node: v8.11.1

Thank you for fixing this @yoadsn !

Was this page helpful?
0 / 5 - 0 ratings