简体   繁体   中英

how to fix ionic error while building template

hi i am trying to build a first app but got some error while extracting

? Starter template: my-first-app
√ Preparing directory .\testarashelia - done!
> git.exe clone https://github.com/ionic-team/photo-gallery-capacitor-ng C:\Users\Arashsoft\Desktop\ionic\testarashelia --progress
Cloning into 'C:\Users\Arashsoft\Desktop\ionic\testarashelia'...
remote: Enumerating objects: 420, done.
remote: Counting objects: 100% (420/420), done.
remote: Compressing objects: 100% (288/288), done.
Rremote: Total 420 (delta 155), reused 347 (delta 89), pack-reused 0eceiving objects:  82% (345/420), 628.00 KiB
Receiving objects: 100% (420/420), 641.00 KiB | 242.00 KiB/s, done.
Resolving deltas: 100% (155/155), done.
Installing dependencies may take several minutes.

  ──────────────────────────────────────────────────────────────

        Ionic Appflow, the mobile DevOps solution by Ionic

           Continuously build, deploy, and ship apps
        Focus on building apps while we automate the rest

        Learn more: https://ion.link/appflow

  ──────────────────────────────────────────────────────────────


> npm.cmd i
npm WARN tarball tarball data for @angular/core@9.0.0 (sha512-6Pxgsrf0qF9iFFqmIcWmjJGkkCaCm6V5QNnxMy2KloO3SDq6QuMVRbN9RtC8Urmo25LP+eZ6ZgYqFYpdD8Hd9w==) seems to be 
corrupted. Trying one more time.
npm ERR! code EPERM
npm ERR! syscall unlink
npm ERR! path C:\Users\Arashsoft\Desktop\ionic\testarashelia\node_modules\.staging\@angular\core-7994b28a\schematics\utils\typescript\nodes.js
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, unlink 'C:\Users\Arashsoft\Desktop\ionic\testarashelia\node_modules\.staging\@angular\core-7994b28a\schematics\utils\typescript\nodes.js'
npm ERR!  [OperationalError: EPERM: operation not permitted, unlink 'C:\Users\Arashsoft\Desktop\ionic\testarashelia\node_modules\.staging\@angular\core-7994b28a\schematics\utils\typescript\nodes.js'] {
npm ERR!   cause: [Error: EPERM: operation not permitted, unlink 'C:\Users\Arashsoft\Desktop\ionic\testarashelia\node_modules\.staging\@angular\core-7994b28a\schematics\utils\typescript\nodes.js'] {
npm ERR!     errno: -4048,
npm ERR!     code: 'EPERM',
npm ERR!     syscall: 'unlink',
npm ERR!     path: 'C:\\Users\\Arashsoft\\Desktop\\ionic\\testarashelia\\node_modules\\.staging\\@angular\\core-7994b28a\\schematics\\utils\\typescript\\nodes.js'  
npm ERR!   },
npm ERR!   stack: "Error: EPERM: operation not permitted, unlink 'C:\\Users\\Arashsoft\\Desktop\\ionic\\testarashelia\\node_modules\\.staging\\@angular\\core-7994b28a\\schematics\\utils\\typescript\\nodes.js'",
npm ERR!   errno: -4048,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'unlink',
npm ERR!   path: 'C:\\Users\\Arashsoft\\Desktop\\ionic\\testarashelia\\node_modules\\.staging\\@angular\\core-7994b28a\\schematics\\utils\\typescript\\nodes.js',   
npm ERR!   parent: 'testarashelia'
npm ERR! }
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 thenpm ERR! permissions of the file and its containing directories, or try running   
npm ERR! the command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Arashsoft\AppData\Roaming\npm-cache\_logs\2020-03-16T10_23_24_373Z-debug.log
Error

at new SubprocessError
(C:\Users\Arashsoft\AppData\Roaming\npm\node_modules\@ionic\cli\node_modules\@ionic\utils-subprocess\dist\index.js:40:23)
at ChildProcess.<anonymous>
(C:\Users\Arashsoft\AppData\Roaming\npm\node_modules\@ionic\cli\node_modules\@ionic\utils-subprocess\dist\index.js:129:27)
at ChildProcess.emit (events.js:311:20)
at ChildProcess.cp.emit
(C:\Users\Arashsoft\AppData\Roaming\npm\node_modules\@ionic\cli\node_modules\cross-spawn\lib\enoent.js:34:29)
at maybeClose (internal/child_process.js:1021:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)

it got stuck at this part tarball tarball data for @angular/core@9.0.0 (sha512-6Pxgsrf0qF9iFFqmIcWmjJGkkCaCm6V5QNnxMy2KloO3SDq6QuMVRbN9RtC8Urmo25LP+eZ6ZgYqFYpdD8Hd9w==) seems to be corrupted. Trying one more time.

What version of Ionic CLI are you using? You need Ionic 5 for Angular 9. If you didn't do so I recommend installing ionic CLI globally as such.

npm i -g @ionic/cli

Also windows in trying to unlink something and you don't have permission. Have you tried executing this in cmd you opened with "Run as administrator"?

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