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.

Not working on Windows

See original GitHub issue

Get the following - which I think is related to the paths not being correct

npm ERR! code EPERM
npm ERR! syscall rename
npm ERR! path C:\Users\david\AppData\Roaming\npm-cache\_npx\10136\node_modules\projen\node_modules\.xmlbuilder2.DELETE\node_modules\@types
npm ERR! dest C:\Users\david\AppData\Roaming\npm-cache\_npx\10136\node_modules\projen\node_modules\xmlbuilder2\node_modules\@types
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, rename 'C:\Users\david\AppData\Roaming\npm-cache\_npx\10136\node_modules\projen\node_modules\.xmlbuilder2.DELETE\node_modules\@types' -> 'C:\Users\david\AppData\Roaming\npm-cache\_npx\10136\node_modules\projen\node_modules\xmlbuilder2\node_modules\@types'
npm ERR!  [OperationalError: EPERM: operation not permitted, rename 'C:\Users\david\AppData\Roaming\npm-cache\_npx\10136\node_modules\projen\node_modules\.xmlbuilder2.DELETE\node_modules\@types' -> 'C:\Users\david\AppData\Roaming\npm-cache\_npx\10136\node_modules\projen\node_modules\xmlbuilder2\node_modules\@types'] {
npm ERR!   cause: [Error: EPERM: operation not permitted, rename 'C:\Users\david\AppData\Roaming\npm-cache\_npx\10136\node_modules\projen\node_modules\.xmlbuilder2.DELETE\node_modules\@types' -> 'C:\Users\david\AppData\Roaming\npm-cache\_npx\10136\node_modules\projen\node_modules\xmlbuilder2\node_modules\@types'] {
npm ERR!     errno: -4048,
npm ERR!     code: 'EPERM',
npm ERR!     syscall: 'rename',
npm ERR!     path: 'C:\\Users\\david\\AppData\\Roaming\\npm-cache\\_npx\\10136\\node_modules\\projen\\node_modules\\.xmlbuilder2.DELETE\\node_modules\\@types',
npm ERR!     dest: 'C:\\Users\\david\\AppData\\Roaming\\npm-cache\\_npx\\10136\\node_modules\\projen\\node_modules\\xmlbuilder2\\node_modules\\@types'
npm ERR!   },
npm ERR!   stack: "Error: EPERM: operation not permitted, rename 'C:\\Users\\david\\AppData\\Roaming\\npm-cache\\_npx\\10136\\node_modules\\projen\\node_modules\\.xmlbuilder2.DELETE\\node_modules\\@types' -> 'C:\\Users\\david\\AppData\\Roaming\\npm-cache\\_npx\\10136\\node_modules\\projen\\node_modules\\xmlbuilder2\\node_modules\\@types'",
npm ERR!   errno: -4048,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'rename',
npm ERR!   path: 'C:\\Users\\david\\AppData\\Roaming\\npm-cache\\_npx\\10136\\node_modules\\projen\\node_modules\\.xmlbuilder2.DELETE\\node_modules\\@types',
npm ERR!   dest: 'C:\\Users\\david\\AppData\\Roaming\\npm-cache\\_npx\\10136\\node_modules\\projen\\node_modules\\xmlbuilder2\\node_modules\\@types',
npm ERR!   parent: 'projen'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It's possible that the file was already in use (by a text editor or antivirus),
npm ERR! or that you lack permissions to access it.
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\david\AppData\Roaming\npm-cache\_logs\2021-01-17T09_59_49_956Z-debug.log
Install for [ 'projen@latest' ] failed with code 4294963248

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:17 (15 by maintainers)

github_iconTop GitHub Comments

3reactions
misterjoshuacommented, Feb 22, 2021

I had the same problem. I got projen working in Windows 10 with Node 14.15.4 LTS by using a project-local node_modules. This is what I did:

PS E:\Proj> yarn init
PS E:\Proj> yarn add --dev projen
PS E:\Proj> yarn projen new awscdk-construct
3reactions
Chriscbrcommented, Jan 19, 2021

Ok I’m able to reproduce the issue on node v14 as well. It can also be reproduced by running npm install -g projen. Unfortunately I’m not sure how to fix it yet - part of the difficulty is that it’s difficult to test “npm install” using local versions of projen with changes. That said, it appears to be caused by the addition of the xmlbuilder2 library in projen 0.13.10 (commit).

The current workarounds I’ve found:

  • Use node v15.x.x or above
  • Install projen globally using yarn global add projen and run projen new <project-type> to bootstrap your project. Then you can run npx projen commands inside the project directory normally. Afterwards, you’re free to remove the global projen command if you’d like to avoid polluting the global namespace via yarn global remove projen.

I’m not really familiar with this kind of bug, but I’d like try pinning different versions of xmlbuilder2 or its dependencies and see if that fixes the bug. Specifically, xmlbuilder2 has a runtime dependency on @types/node which could be causing a conflict of some kind.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Solved] Windows 10 Not Responding | Quickly & Easily
How to Fix Windows 10 not responding · Restart your computer · Troubleshoot your computer · Update available drivers · Run System File...
Read more >
Troubleshoot problems updating Windows - Microsoft Support
Have issues installing Windows updates? Start here. · Free up some drive space so you can run updates · Restart to apply installed...
Read more >
What You Should Do If Windows Fails to Start
The quickest way to get to Startup Repair is to hard-power-down your PC while it's booting three times. You normally do this by...
Read more >
Windows 10 Won't Boot? 12 Fixes to Get Your PC Running ...
1. Try Windows Safe Mode · 2. Check Your Battery · 3. Unplug All Your USB Devices · 4. Turn Off Fast Boot...
Read more >
Windows 10 Troubleshooting: The Most Common Problems ...
Check your Windows 10 device. Make sure airplane mode is turned off (Start > Settings > Network & Internet > Airplane mode). Try...
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