Skip to content

AWS Amplify Storage Browser failed deployment - No prebuild or local build of @parcel/watcher found

0

How do I fix the error when deploying an Amplify app? I am trying to follow https://ui.docs.amplify.aws/react/connected-components/storage/storage-browser step 1 and step 2, and have selected the Github repo: https://github.com/aws-samples/sample-amplify-storage-browser

However, there are errors with the deployment in step 2. The log files are as below:

2025-03-28T05:02:55.238Z [INFO]: # Executing command: npx ampx pipeline-deploy --branch $AWS_BRANCH --app-id $AWS_APP_ID
2025-03-28T05:02:58.490Z [WARNING]: /codebuild/output/src1024886224/src/sample-amplify-storage-browser/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/src1024886224/src/sample-amplify-storage-browser/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)
                                    Node.js v18.18.2
2025-03-28T05:02:58.623Z [ERROR]: !!! Build failed
2025-03-28T05:02:58.623Z [ERROR]: !!! Error: Command failed with exit code 1
2025-03-28T05:02:58.623Z [INFO]: # Starting environment caching...
2025-03-28T05:02:58.624Z [INFO]: # Environment caching completed
AWS
asked a year ago718 views
2 Answers
0

The error you're encountering is related to the @parcel/watcher package, which is not properly installed or configured in your project. This issue can occur when deploying an Amplify app, especially when using certain build tools or frameworks.

To resolve this error, you can try the following steps:

  1. Ensure that all dependencies are properly installed. In your project directory, run:

    npm install --no-optional

    This will install the required dependencies without optional ones, which might be causing the issue.

  2. If the above doesn't work, try installing @parcel/watcher explicitly:

    npm install @parcel/watcher

  3. Make sure your package.json file includes @parcel/watcher in the dependencies or devDependencies section.

  4. If you're using npm, ensure you're not using the --no-optional flag when installing dependencies, as this can prevent necessary packages from being installed.

  5. Check if your build environment supports the required platform. The error message suggests it's looking for a Linux x64 glibc build of @parcel/watcher. Ensure your build environment matches these requirements.

  6. If the issue persists, you may need to configure your build settings in the Amplify Console. Go to your app in the Amplify Console, navigate to the Build settings, and make sure the build commands are correct for your project.

If none of these solutions work, you may need to report the issue to the Parcel bundler GitHub repository as suggested in the error message, or consider using a different bundler or build tool that's compatible with your project and Amplify setup.
Sources
on amplify react app deploy issue | AWS re:Post
Troubleshoot "Stack CDKToolkit already exists" - React - AWS Amplify Gen 2 Documentation
UPDATE_FAILED error: api [unauthRoleName, authRoleName] do not exist in the template | AWS re:Post

answered a year ago
0

The @parcel/watcher is a dependency of @aws-amplify/backend-cli

In the package.json try updating devDependencies:

  "@aws-amplify/backend": "^1.16.1",
    "@aws-amplify/backend-cli": "^1.7.2",

You may also need to add:

  "engine": {
     "node": ">=20.0.0"
   },

Another thing that could be needed are updates to amplify.yml

backend:
  phases:
    build:
      commands:
        - nvm install 20
        - nvm use 20
        - npm ci --cache .npm --prefer-offline
        - npx ampx pipeline-deploy --branch $AWS_BRANCH --app-id $AWS_APP_ID

If you still have the error see if changing npm ci --cache .npm --prefer-offline to npm install --cache .npm --prefer-offline maks any difference

answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.