0

When I execute the command ng new app-name I get error -4058.

When I run the same command opening cmd as administrator in the directory C: / Windows/system32 I have no problems when creating the project. But if I change the directory I have the same issue.

I suppose it must be a permissions problem but it is not solved by opening cmd as administrator.

The creation process is frozen in extract: rxjs: and after a long time I get the following error

npm ERR! path C:\Users\Usuario\proyectName\node_modules\@angular-devkit\build-optimizer\node_modules\typescript npm ERR! code ENOENT npm ERR! errno -4058 npm ERR! syscall rename npm ERR! enoent ENOENT: no such file or directory, rename 'C:\Users\Usuario\proyectName\node_modules\@angular-devkit\build-optimizer\node_modules\typescript' -> 'C:\Users\Usuario\proyectName\node_modules\@angular-devkit\build-optimizer\node_modules.typescript.DELETE' npm ERR! enoent This is related to npm not being able to find a file. npm ERR! enoent

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\Usuario\AppData\Roaming\npm-cache_logs\2018-03-20T02_40_45_377Z-debug.log Error: Package install failed, see above. Package install failed, see above.

Npm version

5.7.1

Angular version

Angular CLI: 1.7.3
Node: 8.10.0
OS: win32 x64
Angular:
...
Vaibhav Mandlik
  • 51
  • 2
  • 13
  • if you are behind any proxy please check your `.npmrc` file which in present in your user/home and check the entry for proxy and https-proxy . also you can disable strict-ssl by `strict-ssl=false` – Sagar Kharab Mar 20 '18 at 03:33
  • I don't user any proxy. – Gianni Boschetto Mar 20 '18 at 20:45
  • then it seems it is some permission issue which is locking your current instance. Please refer [Fail to install npm package “npm ERR! errno -4048” ](https://stackoverflow.com/questions/30860795/fail-to-install-npm-package-npm-err-errno-4048/31327161) – Sagar Kharab Mar 21 '18 at 03:28
  • I was able to solve the problem by uninstalling completely angular / cli and node. After that, reinstall the node (not as administrator). – Gianni Boschetto Mar 23 '18 at 02:37

1 Answers1

0

I was able to solve the problem by uninstalling completely angular/cli and node

  1. Uninstalling angular/cli and nodejs as administrator.
  2. Delete folders from% appdata% (npm, npm-cache)
  3. delete "nodejs" folder from Programs and Files
  4. Reboot
  5. Reintall lastest version node (not as administrator)
  6. Install angular/cli (not as administrator)