Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
728 views
in Technique[技术] by (71.8m points)

node.js - Error: "The operation was rejected by your operating system" when trying to create new angular project using windows powershell

I keep getting the same error message when trying to create a new angular project. I tried to create a new angular project using Windows Powershell with the following commands:

ng new hello-world

-> Would you like to add angular routing? - Yes

-> Stylesheet format? - CSS

I obtained the error message below. I already tried to reinstall angular cli and I'm running Powershell using Administrator.

Installed versions:

Angular CLI: 8.0.6

Node: 10.16.0

OS: win32 x64

Error message:

npm WARN tarball data for tslint@~5.15.0 (sha512-6bIEujKR21/3nyeoX2uBnE8s+tMXCQXhqMmaIPJpHmXJoBJPTLcI7/VHRtUwMhnLVdwLqqY3zmd8Dxqa5CVdJA==) seems to be corrupted. Trying one more time.
npm WARN tarball tarball data for jasmine-spec-reporter@~4.2.1 (sha512-FZBoZu7VE5nR7Nilzy+Np8KuVIOxF4oXDPDknehCYBDE080EnlPu0afdZNmpGDBRCUBv3mj5qgqCRmk6W/K8vg==) seems to be corrupted. Trying one more time.
npm WARN tarball tarball data for acorn@^6.0.5 (sha512-jPTiwtOxaHNaAPg/dmrJ/beuzLRnXtB0kQPQ8JpotKJgTB6rX6c8mlf315941pyjBSaPg8NHXS9fhP4u17DpGA==) seems to be corrupted. Trying one more time.
npm WARN tarball tarball data for @angular/language-service@~8.0.3 (sha512-04XojOo9FJgEQE/rZafnaJQxPEU+//TSzTgpGoIVzCSMx+joCY/ZSSwJZPWxiHlOE57W/zX02ZY+TwcM81oTdw==) seems to be corrupted. Trying one more time.
npm WARN tar ENOENT: no such file or directory, open 'C:UserskontaDesktopProgramming_filesAngularhello-world
ode_modules.staging@angularplatform-browser-447d0944esm2015animationssrcanimation_builder.js'
npm ERR! path C:UserskontaDesktopProgramming_filesAngularhello-world
ode_modules.stagingjasmine-spec-reporter-cbb15ffcscreenshot.gif
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall unlink
npm ERR! Error: EPERM: operation not permitted, unlink 'C:UserskontaDesktopProgramming_filesAngularhello-world
ode_modules.stagingjasmine-spec-reporter-cbb15ffcscreenshot.gif'
npm ERR!  { [Error: EPERM: operation not permitted, unlink 'C:UserskontaDesktopProgramming_filesAngularhello-world
ode_modules.stagingjasmine-spec-reporter-cbb15ffcscreenshot.gif']
npm ERR!   cause:
npm ERR!    { Error: EPERM: operation not permitted, unlink 'C:UserskontaDesktopProgramming_filesAngularhello-world
ode_modules.stagingjasmine-spec-reporter-cbb15ffcscreenshot.gif'
npm ERR!      errno: -4048,
npm ERR!      code: 'EPERM',
npm ERR!      syscall: 'unlink',
npm ERR!      path:
npm ERR!       'C:\Users\konta\Desktop\Programming_files\Angular\hello-world\node_modules\.staging\jasmine-spec-reporter-cbb15ffc\screenshot.gif' },
npm ERR!   stack:
npm ERR!    'Error: EPERM: operation not permitted, unlink 'C:\Users\konta\Desktop\Programming_files\Angular\hello-world\node_modules\.staging\jasmine-spec-reporter-cbb15ffc\screenshot.gif'',
npm ERR!   errno: -4048,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'unlink',
npm ERR!   path:
npm ERR!    'C:\Users\konta\Desktop\Programming_files\Angular\hello-world\node_modules\.staging\jasmine-spec-reporter-cbb15ffc\screenshot.gif',
npm ERR!   parent: 'hello-world' }
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 (though this is not recommended).
npm WARN tar EPERM: operation not permitted, lstat 'C:UserskontaDesktopProgramming_filesAngularhello-world
ode_modules.staging@angular
outer-8388bfd5esm2015srcdirectives'
npm WARN tarball tarball data for [email protected] (sha512-xt5RsIRCEaf6+j9AyOBgvVuAec0i92rgCaS3S+UVf5Z/vF2Hvtsw08wtUTJqp4djwznoAgjSxeCcU4r+CcDBJA==) seems to be corrupted. Trying one more time.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:UserskontaAppDataRoaming
pm-cache\_logs2019-07-01T01_21_13_653Z-debug.log
Package install failed, see above.
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I found the problem: My antivirus was somehow blocking the files without me knowing. It worked once I paused my antivirus during the installation.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...