Skip to content

Unable to NPM Install due to Running postinstall script, failed #72

@TylerSustare

Description

@TylerSustare

Following the deploy to lambda guide here, I'm running into issues when trying to install @as-integrations/aws-lambda. This is happening for version 1.2.0, 1.1.0, 1.01 but not for 1.0.0

I'm using PNPM in a mono repo for my serverless project.

node_modules/.pnpm/@as-integrations+aws-lambda@1.2.0_@apollo+server@4.3.0/node_modules/@as-integrations/aws-lambda: Running postinstall script, failed in 3.6s
.../@as-integrations/aws-lambda postinstall$ npm run build
│ > @as-integrations/aws-lambda@1.2.0 build
│ > npx -p typescript tsc --build tsconfig.build.json
│ ../../../../@types+node@17.0.40/node_modules/@types/node/globals.d.ts(72,13): error TS2403: Subsequent variable declarations must have the same ty
└─ Failed in 3.6s at /Users/tyler/go/src/github.com/tylersustare/project/node_modules/.pnpm/@as-integrations+aws-lambda@1.2.0_@apollo+server@4.3.0/node_modules/@as-integrations/aws-lambda
 ELIFECYCLE  Command failed with exit code 1.

It look like the error is trying to run tsc and running into an issue with variable declarations possibly.

my package.json looks like the following

{
  "name": "api",
  "version": "0.0.0",
  "private": true,
  "scripts": {
    "sls": "serverless"
  },
  "devDependencies": {
    "@aws-sdk/client-dynamodb": "^3.241.0",
    "@aws-sdk/lib-dynamodb": "^3.241.0",
    "@aws-sdk/smithy-client": "^3.234.0",
    "@aws-sdk/types": "^3.226.0",
    "@jest/types": "^29.3.1",
    "@serverless/typescript": "^3.18.0",
    "@types/aws-lambda": "^8.10.98",
    "@types/node": "^17.0.40",
    "aws-sdk-client-mock": "^2.0.1",
    "aws-sdk-client-mock-jest": "^2.0.1",
    "esbuild": "^0.14.42",
    "eslint": "^8.14.0",
    "jest": "^29.0.0",
    "jest-environment-node": "^29.3.1",
    "serverless": "^3.19.0",
    "serverless-domain-manager": "^6.2.1",
    "serverless-esbuild": "^1.30.0",
    "serverless-offline": "^8.8.0",
    "ts-jest": "^29.0.3",
    "ts-node": "^10.8.1",
    "tsconfig": "workspace:*",
    "tsconfig-paths": "^4.0.0",
    "typescript": "^4.7.3"
  },
  "dependencies": {
    "@as-integrations/aws-lambda": "1.2.0",
    "@apollo/server": "^4.3.0",
    "aws-lambda": "^1.0.7",
    "db": "workspace:*",
    "graphql": "^16.6.0",
    "helpers": "workspace:*",
    "models": "workspace:*",
    "ulid": "^2.3.0"
  }
}

Calling it out explicitly here. This is an issue for me in 1.2.0, 1.1.0 and 1.0.1 but reverting to version 1.0.0 did not have this issue 😄

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions