【问题标题】:Google Cloud Function NPM谷歌云函数 NPM
【发布时间】:2021-01-22 20:55:19
【问题描述】:

我正在尝试使用谷歌云功能将 3d 模型转换为图像。我的功能不会部署。我尝试在包文件中使用 ypm install 和 npm install 。

部署失败:

Build failed: npm ERR! code EJSONPARSE
     npm ERR! file /workspace/package.json
     npm ERR! JSON.parse Failed to parse json`
     npm ERR! JSON.parse Unexpected token n in JSON at position 120 while parsing near '...rage": " 
     ^1.6.0"
     npm ERR! JSON.parse npm install"craster"...'
     npm ERR! JSON.parse Failed to parse package.json data.
     npm ERR! JSON.parse package.json must be actual JSON, not just JavaScript.

Package.json 是

{
  "name": "sample-cloud-storage",
  "version": "0.0.1",
  "dependencies": {
    "@google-cloud/storage": "^1.6.0"
    npm install"craster": "^3.1.5"
  }
}

【问题讨论】:

    标签: node.js json npm google-cloud-functions


    【解决方案1】:

    不知道为什么你有npm install 它在哪里。应该是这样的

    {
       "name":"sample-cloud-storage",
       "version":"0.0.1",
       "dependencies":{
          "@google-cloud/storage":"^1.6.0",
          "craster":"^3.1.5"
       }
    }
    

    【讨论】:

    • 我不明白,由于缺少逗号,您是否设法使其工作?还是您只在帖子中错过了昏迷?
    • 我刚刚部署了这个答案,它就像一个魅力。 删除 - npm install*删除逗号
    猜你喜欢
    • 2018-12-19
    • 2019-02-15
    • 2018-12-07
    • 2018-10-02
    • 2020-04-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多