简体   繁体   中英

npm ERR! code ENOPACKAGEJSON when using cordova in netbeans

I am trying to get cordova to run with netbeans. I keep getting error messages,

I created a helloworld html5application provided by netbeans, I downloaded android studios, node.js, git, and cordova, and set the paths. when I check the version of git and cordova in the command line everythings good. please advise. Screenshot of the error message

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)

It looks like you're trying to run npm install without a package.json .

It's impossible to tell what's going on without any way to reproduce the steps. But you could create a package.json by running npm init and then run npm i -S cordova or npm i -S cordova-android if it's an Android application.

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