[英]How to add a javaScript library in Cordova visual studio?
I have been trying to use the twitter api on cordova visual studio, for this I need to use OAuth for authentication for requests. 我一直在尝试在cordova visual studio上使用twitter api,为此,我需要使用OAuth进行请求身份验证。 I would like to use the https://github.com/BoyCook/TwitterJSClient.git twitter client.
我想使用https://github.com/BoyCook/TwitterJSClient.git Twitter客户端。 The built in nuGet package manager does not have this library.
内置的nuGet软件包管理器没有此库。 How can I install this JS library in my cordova msvs?
如何在Cordova MSVS中安装此JS库?
I tried using npm on the command line to intall this library but I get this error. 我尝试在命令行上使用npm来安装此库,但出现此错误。 What does it mean?
这是什么意思?
It looks like this javascript library is published on NPM: https://www.npmjs.com/package/twitter-node-client . 看来此javascript库已发布在NPM上: https : //www.npmjs.com/package/twitter-node-client 。 To add this to your project, open the package.json file and put this in your dependencies section:
要将其添加到您的项目中,请打开package.json文件,并将其放入“依赖项”部分:
"twitter-js-client": "0.0.5"
You'll then see the "Dependencies" node in solution explorer say "(Restoring...)", and soon you'll see a node_modules folder appear in solution explorer. 然后,您将在解决方案资源管理器中看到“ Dependencies”节点,并说“(Restoring ...)”,不久,您将看到一个node_modules文件夹出现在解决方案资源管理器中。 If you don't, turn on "show all files".
如果不这样做,请打开“显示所有文件”。 This is what you should see:
这是您应该看到的:
You can then copy the library files into your www folder and consume them in your app (hopefully they work with Cordova!). 然后,您可以将库文件复制到www文件夹中,并在您的应用程序中使用它们(希望它们与Cordova一起使用!)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.