The operation was rejected by your operating system

Netlify site name: https://taylorstauss.netlify.app

I can’t figure out what this error is telling me. Something to do with installing NPM or running the build script.

Any ideas?

1:03 PM: buildbot version: 9042ba4998dab698f1f37fb8d36912c08a387191
5:01:03 PM: Building without cache
5:01:03 PM: Starting to prepare the repo for build
5:01:03 PM: No cached dependencies found. Cloning fresh repo
5:01:03 PM: git clone https://github.com/ttstauss/taylor-stauss-gatsby
5:01:04 PM: Preparing Git Reference refs/heads/master
5:01:06 PM: Starting build script
5:01:06 PM: Installing dependencies
5:01:06 PM: Python version set to 2.7
5:01:07 PM: Downloading and installing node v14.7.0...
5:01:07 PM: Downloading https://nodejs.org/dist/v14.7.0/node-v14.7.0-linux-x64.tar.xz...
5:01:08 PM: Computing checksum with sha256sum
5:01:08 PM: Checksums matched!
5:01:11 PM: Now using node v14.7.0 (npm v6.14.7)
5:01:11 PM: Started restoring cached build plugins
5:01:11 PM: Finished restoring cached build plugins
5:01:11 PM: Attempting ruby version 2.6.2, read from environment
5:01:13 PM: Using ruby version 2.6.2
5:01:13 PM: Using PHP version 5.6
5:01:13 PM: 5.2 is already installed.
5:01:13 PM: Using Swift version 5.2
5:01:13 PM: Started restoring cached node modules
5:01:13 PM: Finished restoring cached node modules
5:01:13 PM: Installing NPM modules using NPM version 6.14.7
5:01:19 PM: npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
5:01:19 PM: npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
5:01:20 PM: npm WARN checkPermissions Missing write access to /
5:01:21 PM: npm ERR! code EACCES
5:01:21 PM: npm ERR! syscall access
5:01:21 PM: npm ERR! path /
5:01:21 PM: npm ERR! errno -13
5:01:21 PM: npm ERR! Error: EACCES: permission denied, access '/'
5:01:21 PM: npm ERR!  [Error: EACCES: permission denied, access '/'] {
5:01:21 PM: npm ERR!   errno: -13,
5:01:21 PM: npm ERR!   code: 'EACCES',
5:01:21 PM: npm ERR!   syscall: 'access',
5:01:21 PM: npm ERR!   path: '/'
5:01:21 PM: npm ERR! }
5:01:21 PM: npm ERR!
5:01:21 PM: npm ERR! The operation was rejected by your operating system.
5:01:21 PM: npm ERR! It is likely you do not have the permissions to access this file as the current user
5:01:21 PM: npm ERR!
5:01:21 PM: npm ERR! If you believe this might be a permissions issue, please double-check the
5:01:21 PM: npm ERR! permissions of the file and its containing directories, or try running
5:01:21 PM: npm ERR! the command again as root/Administrator.
5:01:21 PM: npm ERR! A complete log of this run can be found in:
5:01:21 PM: npm ERR!     /opt/buildhome/.npm/_logs/2020-08-12T23_01_21_142Z-debug.log
5:01:21 PM: Error during NPM install
5:01:21 PM: Error running command: Build script returned non-zero exit code: 1
5:01:21 PM: Failing build: Failed to build site
5:01:21 PM: Failed during stage 'building site': Build script returned non-zero exit code: 1
5:01:21 PM: Finished processing build request in 18.324244773s

Congratulations, that is an error I haven’t seen before, while debugging ~20000 builds over my 4 years employed at Netlify!

It’s a bit hard to tell, since we can’t see your code (only our build network can; our staff cannot), but it seems you’ve used “/” as a setting somewhere - for npm installation location maybe? Regardless, the build process does not have write permissions to /, so you’ll want to remove that configuration. We set up npm by default for you to write to a good location that we can cache between builds, so hopefully you won’t need any custom settings like that for your builds to work here.

(Want to see how we set it? that part of our build network is open source: https://github.com/netlify/build-image/blob/xenial/run-build-functions.sh#L10-L39)

1 Like

@fool, thanks for getting back to me. Glad I could add some variety to your debugging :stuck_out_tongue:

After thinking about your comment I realized that my initial set up used pnpm. I felt like it wasn’t as straight forward to use pnpm on Netlify vs npm, so I reverted. Part of the pnpm setup required the following in my netlify.toml:

[build.environment]
    NPM_FLAGS="--prefix=/"

Once I removed this, the build worked great.

Thanks for the help!

1 Like

Thanks for sharing the solution here, @taylor. That is very helpful for other people searching this site and our support team appreciates it also.

1 Like