Aft*_*set 8 google-api node.js oauth-2.0 node-modules google-oauth
我正在尝试获得一个非常基本的 oauth 示例,以便在带有express和googleapis的node.js应用程序中工作。运行应用程序时,它会抛出一个TypeError内部 UUID 依赖项,该依赖项包含在 googleapis-common 模块中。此时我有点沮丧,因为我无法找到任何有关此问题的其他信息来让我自己解决它。
如果这能让事情变得更容易的话,它是在文本中:
Exception has occurred: TypeError: Cannot assign to read only property 'name' of function 'function generateUUID(value, namespace, buf, offset) {
    if (typeof value === 'string') {
      value = strin...<omitted>... }'
  at _default (C:\Users\ficar\OneDrive\Desktop\Frontend\node_modules\googleapis-common\node_modules\uuid\dist\v35.js:71:23)
    at Object.<anonymous> (C:\Users\ficar\OneDrive\Desktop\Frontend\node_modules\googleapis-common\node_modules\uuid\dist\v3.js:14:27)
    at Module._compile (internal/modules/cjs/loader.js:1137:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
    at Module.load (internal/modules/cjs/loader.js:985:32)
    at Function.Module._load (internal/modules/cjs/loader.js:878:14)
    at Module.require (internal/modules/cjs/loader.js:1025:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (C:\Users\ficar\OneDrive\Desktop\Frontend\node_modules\googleapis-common\node_modules\uuid\dist\index.js:63:34)
    at Module._compile (internal/modules/cjs/loader.js:1137:30)
被抛出的文件称为“v35.js”。
我最初的想法是,我一定缺少一些额外的库,这些库以不同的方式解释抛出错误的逻辑。渴望了解更多信息并找到解决方案。
小智 0
看起来这就是 uuid 模块的工作原理node_modules/uuid/dist/v35.js
function _default(name, version, hashfunc) {
  function generateUUID(value, namespace, buf, offset) {
    ...
  } // Function#name is not settable on some platforms (#270)
  try {
    generateUUID.name = name; // eslint-disable-next-line no-empty
  } catch (err) {} // For CommonJS default export support
  ...
作者警告(第 4 行注释),该 name 属性可能不可设置,并用空 catch 绕过它
| 归档时间: | 
 | 
| 查看次数: | 741 次 | 
| 最近记录: |