question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

graphql-nextjs: Can't write schema.graphql to file system (Error: EACCES: permission denied, open '/schema.graphql')

See original GitHub issue

Hey all,

Trying to fool around with the graphql-nextjs example to get myself acquainted - but I am seeing problems in the console. In the console I am seeing

[Error: EACCES: permission denied, open '/schema.graphql'] {
  errno: -13,
  code: 'EACCES',
  syscall: 'open',
  path: '/schema.graphql'
}

This is a fresh install as of today. Using node 13.7.0 if this helps.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

7reactions
Edjevw12commented, Apr 6, 2020

I changed __dirname to process.cwd() and it worked for me.

  types: [Query, Mutation, User],
  outputs: {
    typegen: process.cwd() + '/pages/api/nexus-typegen.ts',
    schema: process.cwd() + '/pages/api/schema.graphql',
  },
});
1reaction
nikolasburkcommented, Apr 6, 2020

@Edjevw12 do you mind submitting a PR with this solution 🙂

Read more comments on GitHub >

github_iconTop Results From Across the Web

A complete guide to permissions in a GraphQL API
This guide shows you how to use GraphQL directives, GraphQL middleware resolvers, and the GraphQL shield library to implement permissions.
Read more >
Error handling - Apollo GraphQL Docs
The request was parsed successfully and is valid against the server's schema, but the server couldn't resolve which operation to run.
Read more >
Error when generating prisma: -- EACCES: permission denied ...
It seems like a permission error. You could fix it by changing the ownership of the node_modules/.prisma folder from the root to the...
Read more >
Fullstack app with TypeScript, Next.js, Prisma & GraphQL
Learn how to build a fullstack app using TypeScript, PostgreSQL, Next.js, GraphQL and Prisma. In this article you are going to create a ......
Read more >
How to fix the "Missing write access" error when using npm
sudo means we are running this command as root , the system super user. This is because we don't have permission to write...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found