Howtographql: Missing prisma-client-lib dependency

Created on 27 Jan 2019  路  1Comment  路  Source: howtographql/howtographql

In the graphql-js/4-adding-a-database tutorial I got Cannot find module 'prisma-client-lib error when running the example code below:

const { prisma } = require('./generated/prisma-client')

async function main() {

  // Create a new link
  const newLink = await prisma.createLink({ 
    url: 'www.prisma.io',
    description: 'Prisma replaces traditional ORMs',
  })
  console.log(`Created new link: ${newLink.url} (ID: ${newLink.id})`)

  // Read all links from the database and print them to the console
  const allLinks = await prisma.links()
  console.log(allLinks)
}

main().catch(e => console.error(e))

This is resolved by running yarn add prisma-client-lib as specified in the prisma official documentation.

Most helpful comment

This is actually specified on the next step of the tutorial, so this is not relevant. https://www.howtographql.com/graphql-js/5-connecting-server-and-database/

>All comments

This is actually specified on the next step of the tutorial, so this is not relevant. https://www.howtographql.com/graphql-js/5-connecting-server-and-database/

Was this page helpful?
0 / 5 - 0 ratings