Search code examples
node.jsreactjsamazon-web-servicesaws-amplify

AWS Amplify build fails


I'm trying to update my AWS Amplify app and I get this error, I have no idea what's wrong, everything works just fine locally. I've been trying scanning this log to see if I can understand anything from it but I cannot find what's wrong..

                                 # Executing command: npm ci
2022-01-05T17:14:08.039Z [WARNING]: npm
2022-01-05T17:14:08.040Z [WARNING]: WARN prepare removing existing node_modules/ before installation
2022-01-05T17:14:09.659Z [WARNING]: npm
2022-01-05T17:14:09.662Z [WARNING]: ERR! bindings not accessible from watchpack-chokidar2:fsevents
2022-01-05T17:14:09.776Z [WARNING]: 
2022-01-05T17:14:09.777Z [WARNING]: npm ERR! A complete log of this run can be found in:
                                    npm ERR!     /root/.npm/_logs/2022-01-05T17_14_09_660Z-debug.log
2022-01-05T17:14:09.777Z [HELP]: Outputting the npm debug log
                                 0 info it worked if it ends with ok
                                 1 verbose cli [
                                 1 verbose cli   '/root/.nvm/versions/node/v14.18.1/bin/node',
                                 1 verbose cli   '/root/.nvm/versions/node/v14.18.1/bin/npm',
                                 1 verbose cli   'ci'
                                 1 verbose cli ]
                                 2 info using [email protected]
                                 3 info using [email protected]
                                 4 verbose npm-session c5d07ee86a69a1f6
                                 5 info prepare initializing installer
                                 6 verbose prepare starting workers
                                 7 verbose prepare installation prefix: /codebuild/output/src456198765/src/RDR-AFG
                                 8 verbose prepare using package-lock.json
                                 9 warn prepare removing existing node_modules/ before installation
                                 10 verbose checkLock verifying package-lock data
                                 11 verbose teardown shutting down workers.
                                 12 info teardown Done in 0s
                                 13 verbose stack Error: bindings not accessible from watchpack-chokidar2:fsevents
                                 13 verbose stack     at reqAddr (/root/.nvm/versions/node/v14.18.1/lib/node_modules/npm/node_modules/npm-logical-tree/index.js:159:17)
                                 13 verbose stack     at /root/.nvm/versions/node/v14.18.1/lib/node_modules/npm/node_modules/npm-logical-tree/index.js:129:22
                                 13 verbose stack     at Array.forEach (<anonymous>)
                                 13 verbose stack     at addChild (/root/.nvm/versions/node/v14.18.1/lib/node_modules/npm/node_modules/npm-logical-tree/index.js:128:40)
                                 13 verbose stack     at /root/.nvm/versions/node/v14.18.1/lib/node_modules/npm/node_modules/npm-logical-tree/index.js:133:7
                                 13 verbose stack     at Array.forEach (<anonymous>)
                                 13 verbose stack     at addChild (/root/.nvm/versions/node/v14.18.1/lib/node_modules/npm/node_modules/npm-logical-tree/index.js:128:40)
                                 13 verbose stack     at /root/.nvm/versions/node/v14.18.1/lib/node_modules/npm/node_modules/npm-logical-tree/index.js:133:7
                                 13 verbose stack     at Array.forEach (<anonymous>)
                                 13 verbose stack     at addChild (/root/.nvm/versions/node/v14.18.1/lib/node_modules/npm/node_modules/npm-logical-tree/index.js:128:40)
                                 13 verbose stack     at /root/.nvm/versions/node/v14.18.1/lib/node_modules/npm/node_modules/npm-logical-tree/index.js:133:7
                                 13 verbose stack     at Array.forEach (<anonymous>)
                                 13 verbose stack     at addChild (/root/.nvm/versions/node/v14.18.1/lib/node_modules/npm/node_modules/npm-logical-tree/index.js:128:40)
                                 13 verbose stack     at /root/.nvm/versions/node/v14.18.1/lib/node_modules/npm/node_modules/npm-logical-tree/index.js:133:7
                                 13 verbose stack     at Array.forEach (<anonymous>)
                                 13 verbose stack     at addChild (/root/.nvm/versions/node/v14.18.1/lib/node_modules/npm/node_modules/npm-logical-tree/index.js:128:40)
                                 14 verbose cwd /codebuild/output/src456198765/src/RDR-AFG
                                 15 verbose Linux 4.14.252-195.483.amzn2.x86_64
                                 16 verbose argv "/root/.nvm/versions/node/v14.18.1/bin/node" "/root/.nvm/versions/node/v14.18.1/bin/npm" "ci"
                                 17 verbose node v14.18.1
                                 18 verbose npm  v6.14.15
                                 19 error bindings not accessible from watchpack-chokidar2:fsevents
                                 20 verbose exit [ 1, true ]
2022-01-05T17:14:09.783Z [ERROR]: !!! Build failed
2022-01-05T17:14:09.783Z [ERROR]: !!! Non-Zero Exit Code detected
2022-01-05T17:14:09.783Z [INFO]: # Starting environment caching...
2022-01-05T17:14:09.784Z [INFO]: # Uploading environment cache artifact...
2022-01-05T17:14:09.845Z [INFO]: # Environment caching completed
Terminating logging...```

Solution

  • npm WARN deprecated [email protected]: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
    

    You have to delete package-lock.json file and downgrade your node version to 14x then recreate npm install