amplify-backend icon indicating copy to clipboard operation
amplify-backend copied to clipboard

Backend cannot be deployed with No prebuild or local build of @parcel/watcher found error.

Open rnrnstar2 opened this issue 10 months ago • 2 comments

Environment information

npx amplify info                                                                                                          【 main 】
System:
  OS: macOS 14.0
  CPU: (10) arm64 Apple M2 Pro
  Memory: 220.56 MB / 16.00 GB
  Shell: /bin/zsh
Binaries:
  Node: 20.5.0 - /usr/local/bin/node
  Yarn: 1.22.19 - /usr/local/bin/yarn
  npm: 9.8.0 - /usr/local/bin/npm
  pnpm: 8.15.5 - ~/Library/pnpm/pnpm
NPM Packages:
  @aws-amplify/backend: 0.13.0-beta.20
  @aws-amplify/backend-cli: 0.12.0-beta.22
  aws-amplify: 6.0.28
  aws-cdk: 2.138.0
  aws-cdk-lib: 2.138.0
  typescript: 5.4.5
AWS environment variables:
  AWS_PROFILE = cloudteam
  AWS_DEFAULT_PROFILE = cloudteam
  AWS_STS_REGIONAL_ENDPOINTS = regional
  AWS_NODEJS_CONNECTION_REUSE_ENABLED = 1
  AWS_SDK_LOAD_CONFIG = 1
No CDK environment variables

Description

version: 1
applications:
  - appRoot: packages/shared-backend
    backend:
      phases:
        build:
          commands:
            - echo *** BACKEND BUILD ***
            - npm install
            - npx amplify pipeline-deploy --branch $AWS_BRANCH --app-id $AWS_APP_ID
            - ls -al
    frontend:
      phases:
        build:
          commands:
            - echo *** FRONTEND BUILD ***
            - node -v
            - amplify -v
      artifacts:
        baseDirectory: /
        files:
          - "**/*"
      cache:
        paths: []

[WARNING]: /codebuild/output/src2094350622/src/Oripa/node_modules/@parcel/watcher/index.js:26

throw new Error(`No prebuild or local build of @parcel/watcher found. Tried ${name}. Please ensure it is installed (don't use --no-optional when installing with npm). Otherwise it is possible we don't support your platform yet. If this is the case, please report an issue to https://github.com/parcel-bundler/watcher.`);

Error: No prebuild or local build of @parcel/watcher found. Tried @parcel/watcher-linux-x64-glibc. Please ensure it is installed (don't use --no-optional when installing with npm). Otherwise it is possible we don't support your platform yet. If this is the case, please report an issue to https://github.com/parcel-bundler/watcher.

at Object.<anonymous> (/codebuild/output/src2094350622/src/Oripa/node_modules/@parcel/watcher/index.js:26:13)

at Module._compile (node:internal/modules/cjs/loader:1256:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
at Module.load (node:internal/modules/cjs/loader:1119:32)
at Module._load (node:internal/modules/cjs/loader:960:12)
at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:169:29)
at ModuleJob.run (node:internal/modules/esm/module_job:194:25)

"@aws-amplify/backend": "^0.13.0-beta.15", "@aws-amplify/backend-cli": "^0.12.0-beta.17",

I get an error when trying to generate a backend with the latest version. The sandbox was created using this version, so if you downgrade due to code differences, another error will occur, so please fix the bug.

rnrnstar2 avatar Apr 22 '24 11:04 rnrnstar2

Hi @rnrnstar2, this is caused by this npm bug when using os-specific dependencies. The workaround mentioned in this comment is to delete your node_modules folder and package-lock.json file, then rerun npm install and commit the new package-lock.json file.

edwardfoyle avatar Apr 23 '24 16:04 edwardfoyle

I'm in a monorepo environment, so it's difficult to create package-lock.json. Because the modules share the root node_modules. What should I do in this case?

rnrnstar2 avatar Apr 24 '24 08:04 rnrnstar2

Hey @rnrnstar2, following up on this issue as still experiencing this issue? could you try upgrading the latest version of Amplify backend packages.

ykethan avatar May 07 '24 14:05 ykethan

I'll close it for now as it looks like I'll have a little time until I can check it out.

rnrnstar2 avatar May 10 '24 03:05 rnrnstar2