【问题标题】:how to fix ionic error while building template如何在构建模板时修复离子错误
【发布时间】:2020-06-27 12:03:13
【问题描述】:

您好,我正在尝试构建第一个应用程序,但在提取时遇到了一些错误

? 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)

卡在这部分 @angular/core@9.0.0 (sha512-6Pxgsrf0qF9iFFqmIcWmjJGkkCaCm6V5QNnxMy2KloO3SDq6QuMVRbN9RtC8Urmo25LP+eZ6ZgYqFYpdD8Hd9w==) 的 tarball tarball 数据似乎是 损坏。再试一次。

【问题讨论】:

  • 上面写着Error: EPERM: operation not permitted, unlink 所以搜索那个错误。

标签: node.js angular ionic-framework npm


【解决方案1】:

您使用的是哪个版本的 Ionic CLI?对于 Angular 9,您需要 Ionic 5。如果您没有这样做,我建议您在全局范围内安装 ionic CLI。

npm i -g @ionic/cli

还有试图取消链接而您没有权限的窗口。您是否尝试在使用“以管理员身份运行”打开的 cmd 中执行此操作?

【讨论】:

    猜你喜欢
    • 2016-04-19
    • 1970-01-01
    • 1970-01-01
    • 2021-09-25
    • 1970-01-01
    • 2014-12-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多