Reputation: 31
I'm working on a Gatsby site. Currently I've got it building just fine locally, but when I try to deploy to Gatsby Cloud, it fails during "install project dependencies", with the Raw Logs showing this:
17:39:24 PM:
Cloning into '/usr/src/app/www'...
17:39:29 PM:
npm ERR! bindings not accessible from webpack-dev-server:fsevents
17:39:29 PM:
npm
17:39:29 PM:
ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2021-08-19T23_39_29_074Z-debug.log
17:39:29 PM:
NPM ci --unsafe-perm --prefer-offline --no-audit failure - Command failed with exit code 1 (EPERM): npm ci --unsafe-perm --prefer-offline --no-audit --registry=https://registry.npmjs.org/
17:39:29 PM:
NPM ci --unsafe-perm --prefer-offline --no-audit attempt 1 of 3...
17:39:31 PM:
npm
17:39:31 PM:
ERR! bindings not accessible from webpack-dev-server:fsevents
17:39:31 PM:
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2021-08-19T23_39_31_076Z-debug.log
17:39:31 PM:
NPM ci --unsafe-perm --prefer-offline --no-audit --registry=https://registry.npmjs.org/ failure - Command failed with exit code 1 (EPERM): npm ci --unsafe-perm --prefer-offline --no-audit --registry=https://registry.npmjs.org/
17:39:31 PM:
NPM ci --unsafe-perm --prefer-offline --no-audit --registry=https://registry.npmjs.org/ attempt 2 of 3...
17:39:33 PM:
npm
17:39:33 PM:
ERR! bindings not accessible from webpack-dev-server:fsevents
17:39:33 PM:
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2021-08-19T23_39_33_080Z-debug.log
17:39:33 PM:
NPM ci --unsafe-perm --prefer-offline --no-audit --registry=https://registry.npmjs.org/ failure - Command failed with exit code 1 (EPERM): npm ci --unsafe-perm --prefer-offline --no-audit --registry=https://registry.npmjs.org/
17:39:33 PM:
NPM ci --unsafe-perm --prefer-offline --no-audit --registry=https://registry.npmjs.org/ attempt 3 of 3...
17:39:35 PM:
npm
17:39:35 PM:
ERR! bindings not accessible from webpack-dev-server:fsevents
17:39:35 PM:
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2021-08-19T23_39_35_038Z-debug.log
17:39:35 PM:
NPM ci --unsafe-perm --prefer-offline --no-audit --registry=https://registry.npmjs.org/ failure - Command failed with exit code 1 (EPERM): npm ci --unsafe-perm --prefer-offline --no-audit --registry=https://registry.npmjs.org/
17:39:35 PM:
ERROR Failed to compile: Error: Command failed with exit code 1 (EPERM): npm ci --unsafe-perm --prefer-offline --no-audit --registry=https://registry.npmjs.org/
I'm on a Linux (Ubuntu) OS. Node version 14.16.0.
Even though the error doesn't seem to indicate that the build failed from fsevents not being present (rather that fsevent couldn't access 'bindings'--which is a term I'm pretty lost on, honestly), I did try installing fsevent locally, it failed (not surprisingly because it seems to be for MacOS). But I also tried manually placing it in either the dependencies and devDependencies of my package.json (my thought being that the cloud server would install it). That did not work either.
I'm pretty lost on this one, any help would be appreciated. I'm also not sure where I go to get the complete logs as referenced in the Raw Log above. I'll update if I find those so, if I haven't uploaded them yet, any help on where to go to get those would be appreciated.
Thanks
Upvotes: 3
Views: 5758
Reputation: 29325
Assuming that the site builds locally as you said, the issue to me seems to be related to a mismatching of Node versions between environments (your local machine and Gatsby Cloud).
According to the Environment Variables Specific to Gatsby Cloud docs, you can specify the Node version by setting a NODE_VERSION
environment variable, which by default is set to 12:
NODE_VERSION
: Specify the version of Node.js your project should use. For example,NODE_VERSION=10
. Defaults to 12.
In your case, use a node -v
locally to get your Node version and set the NODE_VERSION
accordingly. This will force the cloud to use the same version as local, hence the same exact working versions.
Further revisions to this topic bypassed the issue by removing the package-lock.json
and ignoring it (adding it to .gitignore
) to let Gatsby Cloud install the dependencies in their own environment.
Upvotes: 3
Reputation: 1766
The Gatsby Cloud support suggested to delete the package-lock.json
file. And that fixed the problem for me!
You need to make sure to also include package-lock.json
into your .gitignore
file in order to prevent it from being uploaded to GitHub the next time you build on your own machine.
Upvotes: -1