Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Yarn install error on Azure App Service #6604

Closed
davet1985 opened this issue Oct 31, 2018 · 8 comments · Fixed by #6621
Closed

Yarn install error on Azure App Service #6604

davet1985 opened this issue Oct 31, 2018 · 8 comments · Fixed by #6621
Assignees
Labels

Comments

@davet1985
Copy link

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: + yarn@1.12.1
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

@ghost ghost assigned torifat Oct 31, 2018
@ghost ghost added the triaged label Oct 31, 2018
@georgiosd
Copy link

georgiosd commented Oct 31, 2018

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

@yoadsn
Copy link
Contributor

yoadsn commented Nov 1, 2018

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?

@georgiosd
Copy link

@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.

@arcanis
Copy link
Member

arcanis commented Nov 1, 2018

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

@georgiosd
Copy link

@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...

@arcanis
Copy link
Member

arcanis commented Nov 1, 2018

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 🙂

@yoadsn
Copy link
Contributor

yoadsn commented Nov 1, 2018

@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

@georgiosd
Copy link

Thank you for fixing this @yoadsn !

davet1985 added a commit to hmcts/cnp-jenkins-library that referenced this issue Nov 9, 2018
* the issue with symlinks on Azure App Service builds has been fixed
* see yarnpkg/yarn#6604 for more info
timja pushed a commit to hmcts/cnp-jenkins-library that referenced this issue Nov 27, 2018
* No longer need to fix yarn version at 1.10

* the issue with symlinks on Azure App Service builds has been fixed
* see yarnpkg/yarn#6604 for more info

* Lock to 1.12.3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants