如何在 Cordova Visual Studio 中添加 javaScript 库? [英] How to add a javaScript library in Cordova visual studio?

查看:36
本文介绍了如何在 Cordova Visual Studio 中添加 javaScript 库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在尝试在cordova Visual Studio 上使用twitter api,为此我需要使用OAuth 对请求进行身份验证.我想使用

解决方案

看起来这个 javascript 库发布在 NPM 上:

然后,您可以将库文件复制到 www 文件夹并在您的应用中使用它们(希望它们与 Cordova 兼容!).

I have been trying to use the twitter api on cordova visual studio, for this I need to use OAuth for authentication for requests. I would like to use the https://github.com/BoyCook/TwitterJSClient.git twitter client. The built in nuGet package manager does not have this library. How can I install this JS library in my cordova msvs?

I tried using npm on the command line to intall this library but I get this error. What does it mean?

解决方案

It looks like this javascript library is published on 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:

"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. 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!).

这篇关于如何在 Cordova Visual Studio 中添加 javaScript 库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆