首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用带有Excel JS外接程序的第三方节点模块

使用带有Excel JS外接程序的第三方节点模块
EN

Stack Overflow用户
提问于 2022-11-30 15:19:05
回答 2查看 28关注 0票数 1

我正在尝试创建一个Excel插件来生成自定义函数(也称为UDF),以便从使用OAUTH1三步进程收集数据的web数据源中提取数据。它类似于OAUTH2进程,但可以连接到本地主机。

我有可以在Node.JS上运行的代码来授权OUATH1进程。它使用以下代码:

代码语言:javascript
复制
`var papaParse = require('papaparse');`
`const express = require("express");`
`const {nanoid} = require("nanoid");`
`const open = require("open");`
`const crypto = require('crypto');`
`const fetch = (...args) => import('node-fetch').then(({default: fetch}) => fetch(...args));`

Excel插件是否在浏览器空间中运行,因而无法进行表示?

我不知道如何在Excel外接程序项目中使用这些库。在更糟糕的情况下,我可以要求用户插件令牌并删除对express的要求,但我仍然需要其他库。

我使用"npm install“、”“等将每个库添加到项目中,并希望能够访问这些库并在项目中使用它们。

下面是我在代码中的上述库中接收到的错误。

代码语言:javascript
复制
`WARNING in ./node_modules/express/lib/view.js 81:13-25`
`Critical dependency: the request of a dependency is an expression`
`@ ./node_modules/express/lib/application.js 22:11-28`
`@ ./node_modules/express/lib/express.js 18:12-36`
`@ ./node_modules/express/index.js 11:0-41`
`@ ./src/functions/functions.js 49:14-32`

`WARNING in ./node_modules/on-finished/index.js 207:11-33`
`Module not found: Error: Can't resolve 'async_hooks' in 'C:\Users\EricLevy\OneDrive - Meridian Business Services\mb_ns_connector_test\mb_ns_connector_test\node_modules\on-finished'`
`@ ./node_modules/express/lib/response.js 23:17-39`
`@ ./node_modules/express/lib/express.js 22:10-31`
`@ ./node_modules/express/index.js 11:0-41`
`@ ./src/functions/functions.js 49:14-32`

`WARNING in ./node_modules/raw-body/index.js 302:11-33`
`Module not found: Error: Can't resolve 'async_hooks' in 'C:\Users\EricLevy\OneDrive - Meridian Business Services\mb_ns_connector_test\mb_ns_connector_test\node_modules\raw-body'`
`@ ./node_modules/body-parser/lib/read.js 16:14-33`
`@ ./node_modules/body-parser/lib/types/raw.js 15:11-29`
`@ ./node_modules/body-parser/index.js 144:15-41`
`@ ./node_modules/express/lib/express.js 15:17-39`
`@ ./node_modules/express/index.js 11:0-41`
`@ ./src/functions/functions.js 49:14-32`

`3 warnings have detailed information that is not shown.`
`Use 'stats.errorDetails: true' resp. '--stats-error-details' to show it.`

`ERROR in ./src/functions/functions.js 56:13-30`
`Module not found: Error: Can't resolve 'crypto' in 'C:\Users\EricLevy\OneDrive - Meridian Business Services\mb_ns_connector_test\mb_ns_connector_test\src\functions'`
EN

回答 2

Stack Overflow用户

发布于 2022-11-30 19:17:11

Office外接程序在web浏览器(嵌入式)中运行.因此,您可以将其视为ExpressJS没有任何意义的客户端应用程序。ExpressJS则用于服务器端(例如,创建API)。

票数 0
EN

Stack Overflow用户

发布于 2022-11-30 19:19:00

Excel外接程序是一个web应用程序,因此它有服务器端和客户端.express服务器运行在服务器端的Node.js中。任何可以在Node.js中使用的库也可以在Excel外接程序中使用。

您的问题中的错误与以下事实无关:您将将web应用程序作为Excel外接程序处理。考虑编辑您的问题和标题(和标签),以删除对外接程序的提及。如果Node.js和Excel专家认为这是关于Excel插件的话,他们可能会忽略这个问题。

我建议您先让您的web应用程序在浏览器中工作。只需省略调用JavaScript的Office.js即可。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/74630143

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档