配置aurelia.json以加载googleapis npm软件包

时间:2019-02-26 10:37:42

标签: typescript npm aurelia google-oauth2

我正在尝试在aurelia打字稿应用程序中配置aurelia.json,使其包含由加载程序加载的googleapis npm程序包,但是在与aurelia-cli进行构建/捆绑时,我总是会出错。

那就是我将其添加到aurelia.json

的方式
 {
        "name": "googleapis",
        "main": "build/src/index",
        "path": "../node_modules/googleapis",
        "resources": []
      },
      {
        "name": "googleapis-common",
        "main": "build/src/index",
        "path": "../node_modules/googleapis-common",
        "resources": []
      },
      {
        "name": "google-auth-library",
        "main": "build/src/index",
        "path": "../node_modules/google-auth-library",
        "resources": []
      }

我得到的错误是

    ------- File not found or not accessible ------
| Location: c:/projects/xyz/src/google-auth-library.js
| Requested by: c:/projects/xyz/src/resources/elements/html-elements/google-auth-button.js
| Is this a package? Make sure that it is configured in aurelia.json and that it is not a Node.js package
 -----------------------------------------------
 ------- File not found or not accessible ------
| Location: c:/projects/xyz/src/googleapis-common.js
| Requested by: c:/projects/xyz/src/resources/elements/html-elements/google-auth-button.js
| Is this a package? Make sure that it is configured in aurelia.json and that it is not a Node.js package
 -----------------------------------------------
 ------- File not found or not accessible ------
| Location: c:/projects/xyz/node_modules/googleapis/build/src/apis.js
| Requested by: c:/projects/xyz/src/resources/elements/html-elements/google-auth-button.js
| Is this a package? Make sure that it is configured in aurelia.json and that it is not a Node.js package
 -----------------------------------------------
 ------- File not found or not accessible ------
| Location: c:/projects/xyz/src/google-auth-library.js
| Requested by: c:/projects/xyz/src/resources/elements/html-elements/google-auth-button.js
| Is this a package? Make sure that it is configured in aurelia.json and that it is not a Node.js package
 -----------------------------------------------
 ------- File not found or not accessible ------
| Location: c:/projects/xyz/src/googleapis-common.js
| Requested by: c:/projects/xyz/src/resources/elements/html-elements/google-auth-button.js
| Is this a package? Make sure that it is configured in aurelia.json and that it is not a Node.js package
 -----------------------------------------------
 ------- File not found or not accessible ------
| Location: c:/projects/xyz/node_modules/googleapis/build/src/apis.js
| Requested by: c:/projects/xyz/src/resources/elements/html-elements/google-auth-button.js
| Is this a package? Make sure that it is configured in aurelia.json and that it is not a Node.js package

要使其正常工作我该怎么办?在aurelia中使用此库的正确方法是什么?

0 个答案:

没有答案