gpt4 book ai didi

node.js - 尝试为 android 构建 apk 并出现 npm 错误

转载 作者:太空宇宙 更新时间:2023-11-03 22:26:18 25 4
gpt4 key购买 nike

嗨,当我尝试运行此命令ionic cordova build android --release我收到以下错误

我已经尝试过

  • 我重新安装了 ionic,Cordova 还是不行
  • 我重新安装了nodeJS
  • 我也卸载了android平台,重新安装了,还是不行。
  • 我尝试安装 cordova-plugin-email-composer
  • 我还尝试了不同的程序,例如 git bash、PowerShell 和命令提示符

    (truncated) ... ww/js/services.js
    File www/js/services.js has no errors.
    -----------------------------------------
    Linting www/js/views.js
    File www/js/views.js has no errors.
    -----------------------------------------
    Discovered plugin "com.rjfun.cordova.iad" in config.xml. Adding it to the project
    Failed to restore plugin "com.rjfun.cordova.iad" from config.xml. You might need to try adding it again. Error:

    Failed to fetch plugin com.rjfun.cordova.iad@^2.0.4 via registry.
    Probably this is either a connection problem, or plugin spec is incorrect.
    Check your connection and plugin name/version/URL.
    Error: cmd: Command failed with exit code 1 Error output:
    npm ERR! Windows_NT 6.1.7601
    npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program
    Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "com.rjfun.cordova.iad@2.0.4"
    npm ERR! node v6.11.2
    npm ERR! npm v3.10.10
    npm ERR! code E404

    npm ERR! 404 Registry returned 404 for GET on https://registry.npmjs.org/com.rjfun.cordova.iad
    npm ERR! 404
    npm ERR! 404 'com.rjfun.cordova.iad' is not in the npm registry.
    npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
    npm ERR! 404
    npm ERR! 404 Note that you can also install from a
    npm ERR! 404 tarball, folder, http url, or git url.

    npm ERR! Please include the following file with any support request:
    npm ERR! C:\Users\fartsstinksodontfart\Desktop\newiconic\hoydesigndiifferent\node_modules\npm-debug.log
    Discovered plugin "cordova-plugin-email-composer" in config.xml. Adding it to the project
    Failed to restore plugin "cordova-plugin-email-composer" from config.xml. You might need to try adding it again.

    Error: Failed to fetch plugin
    cordova-plugin-email-composer@https://github.com/katzer/cordova-plugin-email-composer.git#0.8.2 via registry.
    Probably this is either a connection problem, or plugin spec is incorrect.
    Check your connection and plugin name/version/URL.
    Error: cmd: Command failed with exit code 1 Error output:
    npm ERR! git clone
    C:\Users\fartsstinksodontfart\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-katzer-cordova-plugin- email-composer-git-0-8-2-1181afa8
    C:\Users\FARTSS~1\AppData\Local\Temp\npm-10508-f9448953\git-cache-5f8d071e\cab303daada1d86579b6c76354b8333ae5d1a efe:
    Cloning into
    'C:\Users\FARTSS~1\AppData\Local\Temp\npm-10508-f9448953\git-cache-5f8d071e\cab303daada1d86579b6c76354b8333ae5d1 aefe'...
    npm ERR! git clone
    C:\Users\fartsstinksodontfart\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-katzer-cordova-plugin- email-composer-git-0-8-2-1181afa8
    C:\Users\FARTSS~1\AppData\Local\Temp\npm-10508-f9448953\git-cache-5f8d071e\cab303daada1d86579b6c76354b8333ae5d1a efe:
    error: cannot spawn sh: No such file or directory
    npm ERR! git clone
    C:\Users\fartsstinksodontfart\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-katzer-cordova-plugin- email-composer-git-0-8-2-1181afa8
    C:\Users\FARTSS~1\AppData\Local\Temp\npm-10508-f9448953\git-cache-5f8d071e\cab303daada1d86579b6c76354b8333ae5d1a efe:
    fatal: unable to fork
    npm ERR! git clone
    C:\Users\fartsstinksodontfart\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-katzer-cordova-plugin- email-composer-git-0-8-2-1181afa8
    C:\Users\FARTSS~1\AppData\Local\Temp\npm-10508-f9448953\git-cache-5f8d071e\cab303daada1d86579b6c76354b8333ae5d1a efe:

    npm ERR! Windows_NT 6.1.7601
    npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program
    Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
    "cordova-plugin-email-composer@https://github.com/katzer/cordova-plugin-email-composer.git#0.8.2"
    npm ERR! node v6.11.2
    npm ERR! npm v3.10.10
    npm ERR! code 128

    npm ERR! Command failed: git -c core.longpaths=true clone
    C:\Users\fartsstinksodontfart\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-katzer-cordova-plugin- email-composer-git-0-8-2-1181afa8
    C:\Users\FARTSS~1\AppData\Local\Temp\npm-10508-f9448953\git-cache-5f8d071e\cab303daada1d86579b6c76354b8333ae5d1a efe
    npm ERR! Cloning into
    'C:\Users\FARTSS~1\AppData\Local\Temp\npm-10508-f9448953\git-cache-5f8d071e\cab303daada1d86579b6c76354b8333ae5d1 aefe'...
    npm ERR! error: cannot spawn sh: No such file or directory
    npm ERR! fatal: unable to fork
    npm ERR!
    npm ERR!
    npm ERR! If you need help, you may report this error at:
    npm ERR! <https://github.com/npm/npm/issues>

    npm ERR! Please include the following file with any support request:
    npm ERR! C:\Users\fartsstinksodontfart\Desktop\newiconic\hoydesigndiifferent\node_modules\npm-debug.log
    Running command: "C:\Program Files\nodejs\node.exe"
    C:\Users\fartsstinksodontfart\Desktop\newiconic\hoydesigndiifferent\hooks\after_prepare\010_add_platform_class.j s
    C:\Users\fartsstinksodontfart\Desktop\newiconic\hoydesigndiifferent
    add to body class: platform-android
    Running command: "C:\Program Files\nodejs\node.exe"
    C:\Users\fartsstinksodontfart\Desktop\newiconic\hoydesigndiifferent\hooks\after_prepare\020_remove_sass_from_pla tforms.js
    C:\Users\fartsstinksodontfart\Desktop\newiconic\hoydesigndiifferent

最佳答案

您可能仅在 config.xml 中拥有此插件。使用 CLI 删除和添加插件应该可以解决该问题。它会自动将其添加到 plugins/fetch.json 文件中。

cordova plugin rm com.rjfun.cordova.iad
cordova plugin add com.rjfun.cordova.iad

如果这不起作用。尝试删除node_modules目录,然后npm install

关于node.js - 尝试为 android 构建 apk 并出现 npm 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45850194/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com