question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

npm install task (not msbuild) fails with EPERM on hosted build

See original GitHub issue

It looks like there are some problems with permissions while installing various packages over npm install.

When I run my build for the 1st time I received the following errors:

npm ERR! Error: EPERM, open 'C:\NPM\Cache\bb33797c-ache-minimatch-2-0-8-package-tgz.lock'
npm ERR! { [Error: EPERM, open 'C:\NPM\Cache\bb33797c-ache-minimatch-2-0-8-package-tgz.lock']
npm ERR! errno: 50,
npm ERR! code: 'EPERM',
npm ERR! path: 'C:\\NPM\\Cache\\bb33797c-ache-minimatch-2-0-8-package-tgz.lock' }
npm ERR! 

After that I just run my build for the 2nd time without any modifications and I got the following errors:

npm ERR! Error: EPERM, open 'C:\NPM\Cache\e360d466-Cache-inherits-2-0-1-package-tgz.lock'
npm ERR! { [Error: EPERM, open 'C:\NPM\Cache\e360d466-Cache-inherits-2-0-1-package-tgz.lock']
npm ERR! errno: 50,
npm ERR! code: 'EPERM',
npm ERR! path: 'C:\\NPM\\Cache\\e360d466-Cache-inherits-2-0-1-package-tgz.lock' }
npm ERR! 

I receiving that errors on VSO

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:102 (44 by maintainers)

github_iconTop GitHub Comments

2reactions
Maarten88commented, Jan 2, 2016

Based on this thread, I may have found a workaround: first install npm@3, then run that using a Command Line task to do the actual npm install:

(npm task) -> npm install npm@3
(Command Line task) -> $(Build.SourcesDirectory)\[your project]\node_modules\.bin\npm.cmd

My npm install tasks finished successfully without having to restart it multiple times for the first time in months!

0reactions
bryanmacfarlanecommented, Apr 21, 2016

Closing.

It was confirmed as an npm2 bug and the fix was made to npm2 It’s not a bug in npm3. We finished moving most pools to premium storage in the hosted pool (at our cost) which minimizes the chance if you hit it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Builds randomly fail or succeed on NPM Install
We have a custom NPM install as a project build step and most of the time it succeeds but sometimes it fails. Not...
Read more >
npm - EPERM: operation not permitted on Windows
In my case, I was facing this error because my directory and its file were opened in my editor (VS code) while I...
Read more >
Fix Node MSBuild Exit code 1 | Workaround guide - YouTube
Want to install something using npm, but can't because of an annoying MSBuild error code? Well, this video has a permanent solution that...
Read more >
How to Fix MSBuild: Error MSB3428 - Ryan Hayes
The error message mentions that you need to install MSBuild or Visual Studio. That works, of course, and is one solution. If you...
Read more >
[SOLVED] Node-gyp error, node_modules does not get ...
[SOLVED] Node-gyp error, node_modules does not get created, please help ... To enable parallel build, please add the "/m" switch. npm ERR!
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found