Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Local dependencies prevent the google cloud function from building #276

Open
HariShyamU opened this issue Sep 23, 2021 · 0 comments
Open

Comments

@HariShyamU
Copy link

HariShyamU commented Sep 23, 2021

Issue description
I'm trying to implement code sharing between multiple services by using npm local dependencies. Here is the code structure:

endpoints
-servicename
--package.json
--serverless.yml

libs
-database.js
-auth.js
-package.json

I've added the libs folder as a local dependency to my function like so:

"dependencies": { "libs": "../../libs" }

When the cloud build is initiated for deployment, I get an error shown below during deployment:

Build failed: npm ERR! code EEXIST
npm ERR! syscall mkdir
npm ERR! path /workspace/node_modules/libs
npm ERR! errno -17
npm ERR! EEXIST: file already exists, mkdir '/workspace/node_modules/libs'
npm ERR! File exists: /workspace/node_modules/libs
npm ERR! Remove the existing file and try again, or run npm
npm ERR! with --force to overwrite files recklessly.

Service configuration (serverless.yml) content

service: servicename

provider:
  name: google
  stage: dev
  runtime: nodejs14
  region: asia-south1
  project: project-name
  credentials: "../../creds.json"

frameworkVersion: '2'

plugins:
  - serverless-google-cloudfunctions

package:
  exclude:
    - node_modules/**
    - .gitignore
    - .git/**

functions:
  get:
    handler: servicehandler
    events:
      - http: path

Command name and used flags
serverless deploy --region asia-south1

Environment information
Framework Core: 2.59.0
Plugin: 5.4.4
SDK: 4.3.0
Components: 3.17.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant