Error creating a new Angular project with Angular-Cli

1

Good I am trying to create a new project following the manual of Angular using Angular-Cli. I have installed Node 6.10.0 and npm 3.10.10 in Windows 10 first installed angular cli with the command:

npm install -g @angular/cli que se completo sin errores

but when executing the command to create the project (ng new my-app) I receive the following error:

Installing packages for tooling via npm.

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\chokidar\node_modules\fsevents):

npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

npm ERR! Windows_NT 10.0.14393

npm ERR! argv "C:\Program Files (x86)\nodejs\node.exe" "C:\Program Files (x86)\nodejs\node_modules\npm\bin\npm-cli.js" "--quiet" "install"

npm ERR! node v6.10.0

npm ERR! npm  v3.10.10

npm ERR! path c:\Users\usuario\Documents\workspace\my-app\node_modules\.staging\rx-59741874

npm ERR! code EPERM

npm ERR! errno -4048

npm ERR! syscall rename


npm ERR! Error: EPERM: operation not permitted, rename 'c:\Users\usuario\Documents\workspace\my-app\node_modules\.staging\rx-59741874' -> 'c:\Users\usuario\Documents\workspace\my-app\node_modules\rx'

npm ERR!     at destStatted (C:\Program Files (x86)\nodejs\node_modules\npm\lib\install\action\finalize.js:25:7)

npm ERR!     at C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\graceful-fs\polyfills.js:264:29

npm ERR!     at FSReqWrap.oncomplete (fs.js:123:15)

npm ERR!

npm ERR! Error: EPERM: operation not permitted, rename 'c:\Users\usuario\Documents\workspace\my-app\node_modules\.staging\rx-59741874' -> 'c:\Users\usuario\Documents\workspace\my-app\node_modules\rx'

npm ERR!     at Error (native)

npm ERR!  { Error: EPERM: operation not permitted, rename 'c:\Users\usuario\Documents\workspace\my-app\node_modules\.staging\rx-59741874' -> 'c:\Users\usuario\Documents\workspace\my-app\node_modules\rx'

npm ERR!     at destStatted (C:\Program Files (x86)\nodejs\node_modules\npm\lib\install\action\finalize.js:25:7)

npm ERR!     at C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\graceful-fs\polyfills.js:264:29

npm ERR!     at FSReqWrap.oncomplete (fs.js:123:15)

npm ERR!

npm ERR! Error: EPERM: operation not permitted, rename 'c:\Users\usuario\Documents\workspace\my-app\node_modules\.staging\rx-59741874' -> 'c:\Users\usuario\Documents\workspace\my-app\node_modules\rx'

npm ERR!     at Error (native) parent: 'my-app' }

npm ERR!

npm ERR! Please try running this command again as root/Administrator.

npm ERR! Please include the following file with any support request:

npm ERR!     c:\Users\usuario\Documents\workspace\my-app\npm-debug.log

Package install failed, see above.

The command has been executed in administrator mode, I would greatly appreciate it if someone could tell me that I am failing.

    
asked by Oriol Tortosa 10.04.2017 в 11:36
source

2 answers

3

Fixed, when perishing angular-cli was not installed correctly from the beginning, with the installation of windows-build-tools the problem has been solved this is the sequence that I followed with the antivirus turned off as they said Juan Hernandez and Angel:

Uninstall Angular Cli npm cache clean npm uninstall -g @angular/cli

Install Windwos Build tools npm cache clean npm install --global --production windows-build-tools

Install angular cli npm cache clean npm install -g -f @angular/cli

Thank you very much for your time to all three.

    
answered by 11.04.2017 / 12:23
source
1

You must first clean the cache with:

npm cache clean

Then disable the antivirus you have since some users have reported problems using NOD or antivirus AV, and recreate the project.

ng new my-app
    
answered by 11.04.2017 в 02:03