-2

Is Angular a serious framework anymore if an error or bug seems so rampant and can persist for so long without any documented way of resolving it?

....
24695 silly saveTree | +-- builtin-modules@1.1.1
24695 silly saveTree | +-- semver@5.7.1
24695 silly saveTree | `-- tsutils@2.29.0
24695 silly saveTree +-- typescript@3.5.3
24695 silly saveTree `-- zone.js@0.9.1
24696 warn optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules\karma\node_modules\fsevents):
24697 warn enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'D:\wamp64\www\SALES-IMS\node_modules\.staging\fsevents-25de8bdf\node_modules\abbrev' -> 'D:\wamp64\www\SALES-IMS\node_modules\.staging\abbrev-5ccfe549'
24698 verbose enoent SKIPPING OPTIONAL DEPENDENCY: This is related to npm not being able to find a file.
24698 verbose enoent SKIPPING OPTIONAL DEPENDENCY:
24699 verbose stack Error: EPERM: operation not permitted, unlink 'D:\wamp64\www\SALES-IMS\node_modules\.staging\typescript-4e9060a8\lib\tsserver.js'
24700 verbose cwd D:\wamp64\www\SALES-IMS
24701 verbose Windows_NT 10.0.17134
24702 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "--quiet"
24703 verbose node v12.11.1
24704 verbose npm  v6.11.3
24705 error code EPERM
24706 error syscall unlink
24707 error path D:\wamp64\www\SALES-IMS\node_modules\.staging\typescript-4e9060a8\lib\tsserver.js
24708 error errno -4048
24709 error Error: EPERM: operation not permitted, unlink 'D:\wamp64\www\SALES-IMS\node_modules\.staging\typescript-4e9060a8\lib\tsserver.js'
24709 error  [OperationalError: EPERM: operation not permitted, unlink 'D:\wamp64\www\SALES-IMS\node_modules\.staging\typescript-4e9060a8\lib\tsserver.js'] {
24709 error   cause: [Error: EPERM: operation not permitted, unlink 'D:\wamp64\www\SALES-IMS\node_modules\.staging\typescript-4e9060a8\lib\tsserver.js'] {
24709 error     errno: -4048,
24709 error     code: 'EPERM',
24709 error     syscall: 'unlink',
24709 error     path: 'D:\\wamp64\\www\\SALES-IMS\\node_modules\\.staging\\typescript-4e9060a8\\lib\\tsserver.js'
24709 error   },
24709 error   stack: "Error: EPERM: operation not permitted, unlink 'D:\\wamp64\\www\\SALES-IMS\\node_modules\\.staging\\typescript-4e9060a8\\lib\\tsserver.js'",
24709 error   errno: -4048,
24709 error   code: 'EPERM',
24709 error   syscall: 'unlink',
24709 error   path: 'D:\\wamp64\\www\\SALES-IMS\\node_modules\\.staging\\typescript-4e9060a8\\lib\\tsserver.js',
24709 error   parent: 'SALES-IMS'
24709 error }
24710 error The operation was rejected by your operating system.
24710 error It's possible that the file was already in use (by a text editor or antivirus),
24710 error or that you lack permissions to access it.
24710 error
24710 error If you believe this might be a permissions issue, please double-check the
24710 error permissions of the file and its containing directories, or try running
24710 error the command again as root/Administrator.
24711 verbose exit [ -4048, true ]

I have tried the following to no avail.

  • I have disabled the antivirus and
  • severally repeated the install,
  • reboot my machine,
  • ensured VS Studio Code is closed...,
  • run npm cache clean, then npm cache clean --force, manually deleted both npm cache and npm folders under the %APPDATA% path and then reinstalled angular with npm install -g @angular/cli

all to the same EPERM error,... different files but same errno -4048.

I have enough GB's of free space on hard drive, there's also nothing peculiar about permissions. Am an admin in the Windows 10 laptop. Every CMD instruction am running as administrator. It has been weeks on end, tried all sorts of suggestions online... and no solution in sight.

Finally, is there a way out of this? Or do I just abandon Angular for being a unreliable unusable framework?

EdNdee
  • 745
  • 1
  • 10
  • 18
  • Possible duplicate of [Fail to install npm package "npm ERR! errno -4048"](https://stackoverflow.com/questions/30860795/fail-to-install-npm-package-npm-err-errno-4048) – Edric Nov 13 '19 at 08:19
  • It's probably not caused by Angular being a "trash" or "unreliable and unusable" framework, but due to your file system or programs open that cause the installation to not continue. – Edric Nov 13 '19 at 08:19
  • By the way, you seem to have created a similar question about a month ago: https://stackoverflow.com/questions/58334156/angular-version-8-every-effort-to-do-ng-new-ends-in-npm-err-error-eperm-ope – Edric Nov 13 '19 at 08:21
  • @Edric I hear you, but there's absolutely no instances of any programs that have opened the relevant files... I have come straight from a reboot... No Node.js processes are open, no editors opened, the antivirus is disabled. I think the problem may actually be with Node.js... Not Angular itself. – EdNdee Nov 13 '19 at 09:15
  • Maybe because you're running the command with sudo access? This may mess up the file permissions. – Edric Nov 13 '19 at 09:29
  • @Edric Am on Windows 10 as noted on the post... – EdNdee Nov 13 '19 at 10:48

2 Answers2

0

I have finally been able to figure out a solution. Which is, to install the failing packages, each at a time using npm install package --force.

For instance, in my case it was npm install -g @angular/core@~8.2.13 --force and npm install -g typescript@~3.5.3 --force.

After which I then repeat ng new project-name command as before. It now works successfully.

Nothing else that has been suggested worked, not in my case.

Much thanks!

EdNdee
  • 745
  • 1
  • 10
  • 18
  • People may have ignored this solution but it has resolved my failed installs every time since I discovered it! – EdNdee Jan 03 '20 at 11:03
-1

This doesn't have anything to do with Angular itself, but with your NodeJS installation and npm. The first step would be to ensure there is no real permission issue.

I Was facing the same and similar errors running npm install for an existing Angular 7 project for several weeks now. Finally decided to switch from npm to yarn and everything worked fine since then. Switching to yarn as package manager did the trick for me after inconsistent and random errors with npm annoyed me for several weeks.

Maybe downgrading to an older npm version (~5.3.0) could also fix that issue.

Bullit_
  • 16
  • 4
  • Unfortunately, I cannot downgrade or use yarn. I need npm and the latest features of Node.js because I also work with Expo for my work in React Native. – EdNdee Nov 13 '19 at 09:34