简体   繁体   中英

Problem in Creating an angular project with NodeJS

I'm trying to create a project after installing angular-cli in my system. When I give ng new project-name command I'm getting an error as follows.

ERROR:

 21328 verbose stack Error: EPERM: operation not permitted, unlink 'C:\\Windows\\System32\\sampleproject\\node_modules\\.staging\\typescript-d81c34c0\\lib\\typescript.js' 21329 verbose cwd C:\\Windows\\System32\\sampleproject 21330 verbose Windows_NT 10.0.17134 21331 verbose argv "C:\\\\Program Files\\\\nodejs\\\\node.exe" "C:\\\\Program Files\\\\nodejs\\\\node_modules\\\\npm\\\\bin\\\\npm-cli.js" "install" "--quiet" 21332 verbose node v12.6.0 21333 verbose npm v6.9.0 21334 error path C:\\Windows\\System32\\sampleproject\\node_modules\\.staging\\typescript-d81c34c0\\lib\\typescript.js 21335 error code EPERM 21336 error errno -4048 21337 error syscall unlink 21338 error Error: EPERM: operation not permitted, unlink 'C:\\Windows\\System32\\sampleproject\\node_modules\\.staging\\typescript-d81c34c0\\lib\\typescript.js' 21338 error [OperationalError: EPERM: operation not permitted, unlink 'C:\\Windows\\System32\\sampleproject\\node_modules\\.staging\\typescript-d81c34c0\\lib\\typescript.js'] { 21338 error cause: [Error: EPERM: operation not permitted, unlink 'C:\\Windows\\System32\\sampleproject\\node_modules\\.staging\\typescript-d81c34c0\\lib\\typescript.js'] { 21338 error errno: -4048, 21338 error code: 'EPERM', 21338 error syscall: 'unlink', 21338 error path: 'C:\\\\Windows\\\\System32\\\\sampleproject\\\\node_modules\\\\.staging\\\\typescript-d81c34c0\\\\lib\\\\typescript.js' 21338 error }, 21338 error stack: "Error: EPERM: operation not permitted, unlink 'C:\\\\Windows\\\\System32\\\\sampleproject\\\\node_modules\\\\.staging\\\\typescript-d81c34c0\\\\lib\\\\typescript.js'", 21338 error errno: -4048, 21338 error code: 'EPERM', 21338 error syscall: 'unlink', 21338 error path: 'C:\\\\Windows\\\\System32\\\\sampleproject\\\\node_modules\\\\.staging\\\\typescript-d81c34c0\\\\lib\\\\typescript.js', 21338 error parent: 'sampleproject' 21338 error } 21339 error The operation was rejected by your operating system. 21339 error It's possible that the file was already in use (by a text editor or antivirus), 21339 error or that you lack permissions to access it. 21339 error 21339 error If you believe this might be a permissions issue, please double-check the 21339 error permissions of the file and its containing directories, or try running 21339 error the command again as root/Administrator (though this is not recommended). 21340 verbose exit [ -4048, true ]

What is the problem with this and how to resolve this?

Can some one help me out with this?

It seems is a Windows permissions problem, firstly try to do the following:

npm cache clean

If that doesn't fix the problem, look at %APPDATA%\\npm-cache to clean this directory, or in PowerShell you can run, $env:APPDATA\\npm-cache .

After cleaning the cache, you may still be left with remnants. Manually remove everything in that directory, and try again.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM