Skip to content

Is code fighting with npm? #28593

Closed
Closed

Description

  • VSCode Version: Code 1.13.0 (376c52b, 2017-06-08T16:43:13.058Z)
  • OS Version: Windows_NT ia32 10.0.10586
  • Extensions:
Extension Author Version
githistory donjayamanne 0.2.0
auto-close-tag formulahendry 0.4.2
auto-rename-tag formulahendry 0.0.12
csharp ms-vscode 1.10.0
PowerShell ms-vscode 1.3.2
vscode-sort-json richie5um2 1.9.0
vscode-icons robertohuertasm 7.9.0

Steps to Reproduce:

  1. In a node project, open up the terminal in Code.
  2. Perform an npm install
  3. Experience some variant of npm ERR! Error: EPERM: operation not permitted, rename

Close code, perform the operation in powershell / cmd. Operation succeeds.

I've only just started experiencing this in the last week or so and it's not consistent. Sometimes installs succeed. But I've experienced it on 2 separate computers, both running code and wondered if that could be the common factor...

Activity

  1. DickvdBrink commented on Jun 13, 2017

    @DickvdBrink
    Contributor

    I had the same issue, for me updating to 5.0.3 (I had 5.0.0) fixed my issue.
    What is your npm version?

  2. johnnyreilly commented on Jun 13, 2017

    @johnnyreilly
    Author

    I tried the latest versions from 3/4/5 including 5.0.3. I'm pretty sure I received it consistently with all though (error message differed slightly but same general gist)

  3. yizhoucao commented on Jun 13, 2017

    @yizhoucao

    same issue here after upgrade to latest 1.13.0

  4. added
    terminal
    on Jun 13, 2017
  5. added
    info-needed
    on Jun 13, 2017
  6. johnnyreilly commented on Jun 13, 2017

    @johnnyreilly
    Author

    Sure - I'll give it a go tomorrow and report back

  7. johnnyreilly commented on Jun 14, 2017

    @johnnyreilly
    Author

    Rolled back to 1.12.2 and I haven't experienced the issue again. It looks like the problem may be vs code

  8. johnnyreilly commented on Jun 14, 2017

    @johnnyreilly
    Author

    As an aside, I also noticed that the "right click on taskbar / left click on recent folder" vs code launch functionality also works with 1.12.2 whereas it mostly doesn't in 1.13.0. Has that been raised elsewhere as well?

  9. kenoyer130 commented on Jun 16, 2017

    @kenoyer130

    Hi, we are a development team of 30 plus developers and this just started to happen and is killing us. Is there an ETA on a fix? Also we have had problems where the file will be corrupted and have to be manually deleted even after closing Visual Code.

    The same Error: EPERM: operation not permitted, rename 'foo' -> 'foo.DELETE'

  10. Tyriar commented on Jun 16, 2017

    @Tyriar
    Contributor

    Does the regression occur with PowerShell only?

  11. rstropek commented on Jun 16, 2017

    @rstropek

    I use bash with VSCode (bash on Ubuntu on Windows 10), same problem. I have to close VSCode, perform npm install, and start VSCode again. If I run npm install while VSCode is running, it fails for random packages. The error occurs with bash running in VSCode and with bash running independently.

  12. 68 remaining items

  13. ccarse commented on Aug 21, 2017

    @ccarse

    I'm also having this problem, usually with the fsevents package. I am also running anti virus that I cannot disable. I'm running 1.15.1

  14. ccarse commented on Aug 21, 2017

    @ccarse

    Matt Bierner (@mjbvz) Should we open new issues for people who are still experiencing this issue? Or should this issue be reopened?

  15. filipesilva commented on Aug 21, 2017

    @filipesilva

    There's an issue on npm for the same thing: npm/npm#17671

    Perhaps the new problem is not related to VSCode directly.

  16. ccarse commented on Aug 21, 2017

    @ccarse

    You know I think you're right. Usually closing code fixes this issue but it's still happening for me now even when code's not running. Thanks!

  17. DickvdBrink commented on Aug 22, 2017

    @DickvdBrink
    Contributor

    Had the same issue indeed without VSCode, but I did have Visual Studio 2017 open which was running a TSServer. Still might not be related though, but I don't think it is VSCode it's fault.

  18. twastvedt commented on Aug 23, 2017

    @twastvedt

    For me this is still an issue. I am able to install just fine after closing VSCode so it does seem to be an issue with VSCode and not npm.

  19. einarpersson commented on Aug 25, 2017

    @einarpersson

    Downgrading to npm version 5.0.4 seems to have solved the problem for me
    (npm install -g [email protected])

    Filipe Silva (@filipesilva): Yes, it seems to be a more general problem of npm not being happy with many processes working on the same files. npm/npm#17671 That would explain why the problem arises when you're working in the same folder in vscode, perhaps?

  20. filipesilva commented on Aug 25, 2017

    @filipesilva

    To be perfectly honest I don't think it's related to VSCode at all. I think that it's the combo of:

    • people reporting the problem use VSCode on npm projects.
    • the second install always works, regardless of having VSCode open or not.
  21. einarpersson commented on Aug 25, 2017

    @einarpersson

    Well, even if the root cause isn't VSCode there still seems to be a correlation. I can at least on my part say that I've had a lot of problems installing npm packages while in the VSCode terminal but not as much as when I've closed VSCode. And the second install does not always work for me. But it's not a 1-1 causation and reading from the other thread I would agree that the problem seems to has it root somewhere else.

    In any case, downgrading npm seems to work 100% for now for me at least. How about you?

  22. filipesilva commented on Aug 25, 2017

    @filipesilva

    I didn't try downgrading because I had a bunch of problems with older 5.x versions... I tried upgrading to 5.4 and ran into npm/npm#18287.

    There's a report of using --no-optional to fix these issues as well in #17671 (see my comment npm/npm#17671 (comment) and the commit right above it).

  23. electrotype commented on Aug 25, 2017

    @electrotype

    What I find strange about all those new comments saying that it may not be an issue with VSCode but with npm itself, is that I downgraded and sticked with VSCode 1.12.2 (as suggested here) since this issue appeared and never experienced it again...

  24. rubenprins commented on Aug 25, 2017

    @rubenprins

    Filipe Silva (@filipesilva) The problem does not always go away if you install a second time. This works only some of the times. In fact: if this problem happens, I can only rarely resolve the error by running npm install again.

    Closing VSCode does always solve the problem, however (for me, at least), and I've only once seen the problem without VSCode running.

    So to me, current VSCode versions at the very least cause the bug to surface, while older versions of VSCode do not, regardless of where in the source code or in which program the bug actually resides.

  25. filipesilva commented on Aug 25, 2017

    @filipesilva

    My bad, my recollection was that I always reinstalled a second time and it seemed to be fine.

  26. shaunpitt commented on Aug 28, 2017

    @shaunpitt

    I'm having the same issue here. Win 10 and VS Code 1.15.1 64-bit. Tried running as Administrator same issues.
    Running Terminal in VSCode
    npm ERR! Windows_NT 10.0.15063
    npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install" "gulp"
    npm ERR! node v6.10.3
    npm ERR! npm v3.10.10
    npm ERR! file C:\Users\ShaunPitt\package.json
    npm ERR! code EJSONPARSE

    npm ERR! Failed to parse json
    npm ERR! No data, empty input at 1:1
    npm ERR!
    npm ERR! ^
    npm ERR! File: C:\Users\xxxxxxxx\package.json
    npm ERR! Failed to parse package.json data.
    npm ERR! package.json must be actual JSON, not just JavaScript.
    npm ERR!
    npm ERR! This is not a bug in npm.
    npm ERR! Tell the package author to fix their package.json file. JSON.parse

    npm ERR! Please include the following file with any support request:
    npm ERR! C:\Users\xxxxx\some-folder\npm-debug.log

    And running PowerShell while VSCode still open:

    PS C:\WINDOWS\system32> npm install gulp
    npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
    npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
    npm WARN deprecated [email protected]: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon
    as possible. Use 'npm ls graceful-fs' to find it in the tree.
    C:\WINDOWS\system32
    `-- [email protected]

    npm WARN enoent ENOENT: no such file or directory, open 'C:\WINDOWS\system32\package.json'
    npm WARN system32 No description
    npm WARN system32 No repository field.
    npm WARN system32 No README data
    npm WARN system32 No license field.

    This is really a struggle. I think i will go back to 1.12 as it seems the best right now.

    Shaun

  27. locked and limited conversation to collaborators on Nov 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugtypescript

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions