簡體   English   中英

npm ERR! 在netbeans中使用cordova時的代碼ENOPACKAGEJSON

[英]npm ERR! code ENOPACKAGEJSON when using cordova in netbeans

我試圖讓cordova與netbeans一起運行。 我不斷收到錯誤消息,

我創建了由netbeans提供的helloworld html5應用程序,下載了android studios,node.js,git和cordova,並設置了路徑。 當我在命令行中檢查git和cordova的版本時,一切都很好。 請指教。 錯誤消息的屏幕截圖

check-android-template:
check-cordova-version:
check-cordova-project:
upgrade-to-cordova-project:
create-android:
update-plugins:
cordova.cmd plugins 
cordova.cmd -d plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-dialogs.git
No scripts found for hook "before_plugin_add".
Calling plugman.fetch on plugin "https://git-wip-us.apache.org/repos/asf/cordova-plugin-dialogs.git"
fetch: Installing https://git-wip-us.apache.org/repos/asf/cordova-plugin-dialogs.git to C:\Users\SONY\Documents\NetBeansProjects\HTML5Application
Running command: npm install https://git-wip-us.apache.org/repos/asf/cordova-plugin-dialogs.git --production --save
Failed to fetch plugin https://git-wip-us.apache.org/repos/asf/cordova-plugin-dialogs.git via registry.Command finished with error code 1: npm install,https://git-wip-us.apache.org/repos/asf/cordova-plugin-dialogs.git,--production,--save
Probably this is either a connection problem, or plugin spec is incorrect.
Check your connection and plugin name/version/URL.
Error: npm: Command failed with exit code 1 Error output:
npm ERR! code ENOPACKAGEJSON
npm ERR! package.json Non-registry package missing package.json: https://git-wip-us.apache.org/repos/asf/cordova-plugin-dialogs.git.
npm ERR! package.json npm can't find a package.json file in your current directory.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\SONY\AppData\Roaming\npm-cache\_logs\2019-08-10T17_29_09_382Z-debug.log

CordovaError: Failed to fetch plugin https://git-wip-us.apache.org/repos/asf/cordova-plugin-dialogs.git via registry.
Probably this is either a connection problem, or plugin spec is incorrect.
Check your connection and plugin name/version/URL.
Error: npm: Command failed with exit code 1 Error output:
npm ERR! code ENOPACKAGEJSON
npm ERR! package.json Non-registry package missing package.json: https://git-wip-us.apache.org/repos/asf/cordova-plugin-dialogs.git.
npm ERR! package.json npm can't find a package.json file in your current directory.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\SONY\AppData\Roaming\npm-cache\_logs\2019-08-10T17_29_09_382Z-debug.log
    at C:\Users\SONY\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\plugman\fetch.js:146:43
    at processTicksAndRejections (internal/process/task_queues.js:85:5)
C:\Users\SONY\Documents\NetBeansProjects\HTML5Application\nbproject\build.xml:235: exec returned: 1
BUILD FAILED (total time: 48 seconds)

看起來您正在嘗試運行不帶package.json的 npm install

沒有任何方法可以重現這些步驟,這是不可能告訴正在發生的事情的。 但是您可以通過運行npm init來創建package.json ,然后運行npm i -S cordovanpm i -S cordova-android如果它是Android應用程序)。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM