Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
660 views
in Technique[技术] by (71.8m points)

phonegap plugins - Cordova - Current working directory is not a Cordova-based project

I'm using phonegap for my mobile project. My question is why I got this error when I try to search phonegap plugin using cordova CLI? I run this command in terminal to search phonegap plugin

cordova plugin search bar code

Full error message

Last login: Wed Jan 22 15:04:09 on ttys000
Mohammads-MacBook-Pro:~ mohammadnurdin$ cd /Applications/MAMP/htdocs/rmbp/apps/rmbp/iphone/native
Mohammads-MacBook-Pro:native mohammadnurdin$ cordova plugin search bar code

/usr/local/lib/node_modules/cordova/src/util.js:57
            throw new Error('Current working directory is not a Cordova-based 
                  ^
Error: Current working directory is not a Cordova-based project.
    at Object.module.exports.cdProjectRoot (/usr/local/lib/node_modules/cordova/src/util.js:57:19)
    at CLI.plugin (/usr/local/lib/node_modules/cordova/src/plugin.js:28:36)
    at new CLI (/usr/local/lib/node_modules/cordova/src/cli.js:109:30)
    at Object.<anonymous> (/usr/local/lib/node_modules/cordova/bin/cordova:41:16)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
Mohammads-MacBook-Pro:native mohammadnurdin$ 
question from:https://stackoverflow.com/questions/21276294/cordova-current-working-directory-is-not-a-cordova-based-project

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You have to be in a project before you launch cordova plugin search bar code.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...