How to use the prisma2/package.json.version function in prisma2

To help you get started, we’ve selected a few prisma2 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github prisma / photonjs / packages / photon / scripts / postinstall.js View on Github external
function getLocalPackagePath() {
  let packagePath
  try {
    packagePath = require.resolve('prisma2/package.json')
  } catch (e) {
    return null
  }

  if (packagePath) {
    const pkg = require('prisma2/package.json')
    const photonVersion = require('../package.json').version
    if (pkg.version !== photonVersion) {
      console.error(
        `${c.red('Error')} ${c.bold(
          '@prisma/photon',
        )} and the locally installed ${c.bold(
          'prisma2',
        )} must have the same version:
  ${c.bold(`@prisma/photon@${photonVersion}`)} doesn't match ${c.bold(
          `prisma2@${pkg.version}`,
        )}`,
      )
    }
    return require.resolve('prisma2')
  }

  return null
}
github prisma / photonjs / packages / photon / scripts / postinstall.js View on Github external
} catch (e) {
    return null
  }

  if (packagePath) {
    const pkg = require('prisma2/package.json')
    const photonVersion = require('../package.json').version
    if (pkg.version !== photonVersion) {
      console.error(
        `${c.red('Error')} ${c.bold(
          '@prisma/photon',
        )} and the locally installed ${c.bold(
          'prisma2',
        )} must have the same version:
  ${c.bold(`@prisma/photon@${photonVersion}`)} doesn't match ${c.bold(
          `prisma2@${pkg.version}`,
        )}`,
      )
    }
    return require.resolve('prisma2')
  }

  return null
}

prisma2

The package `prisma2` has been renamed to [`@prisma/cli`](https://www.npmjs.com/package/@prisma/cli)

Apache-2.0
Latest version published 5 years ago

Package Health Score

69 / 100
Full package analysis

Popular prisma2 functions