Closed Albert-Gao closed 4 years ago
After adding @prisma/photon
to dep list, seems it is working?
......
.....
> graphql-auth@ postinstall /Users/AlbertGao/codes/temp/prisma2-ts-graphql-auth
> npm -s run generate
> Downloading darwin binary for query-engine [====================] 100%
Generating Photon.js to ./node_modules/@prisma/photon
Done in 2.64s
You should specify a configuration value for outputs in Nexus' makeSchema. Provide one to remove this warning.
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN graphql-shield@5.7.3 requires a peer of graphql-middleware@^2.0.0 || ^3.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN graphql-playground-middleware-lambda@1.7.12 requires a peer of aws-lambda@^0.1.2 but none is installed. You must install peer dependencies yourself.
npm WARN graphql-subscriptions@0.5.8 requires a peer of graphql@^0.10.5 || ^0.11.3 || ^0.12.0 || ^0.13.0 but none is installed. You must install peer dependencies yourself.
npm WARN apollo-server-core@1.4.0 requires a peer of graphql@^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 but none is installed. You must install peer dependencies yourself.
npm WARN apollo-cache-control@0.1.1 requires a peer of graphql@0.10.x - 0.13.x but none is installed. You must install peer dependencies yourself.
npm WARN apollo-tracing@0.1.4 requires a peer of graphql@0.10.x - 0.13.x but none is installed. You must install peer dependencies yourself.
npm WARN graphql-extensions@0.0.10 requires a peer of graphql@0.10.x - 0.13.x but none is installed. You must install peer dependencies yourself.
npm WARN graphql-auth@ No repository field.
added 385 packages from 350 contributors and audited 787 packages in 23.387s
2 packages are looking for funding
run `npm fund` for details
found 1 low severity vulnerability
run `npm audit fix` to fix them, or `npm audit` for details
AlbertGao@Albert-LottoNZ-Laptop prisma2-ts-graphql-auth %
This warning You should specify a configuration value for outputs in Nexus' makeSchema. Provide one to remove this warning.
needs to fix or just ignore?
Anyway, the npm run start
and npm run build
have errors:
AlbertGao@Albert-LottoNZ-Laptop prisma2-ts-graphql-auth % npm run start
> graphql-auth@ start /Users/AlbertGao/codes/temp/prisma2-ts-graphql-auth
> node dist/server
internal/modules/cjs/loader.js:957
throw err;
^
Error: Cannot find module '/Users/AlbertGao/codes/temp/prisma2-ts-graphql-auth/dist/server'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:954:17)
at Function.Module._load (internal/modules/cjs/loader.js:847:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:67:12)
at internal/main/run_main_module.js:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! graphql-auth@ start: `node dist/server`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the graphql-auth@ start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/AlbertGao/.npm/_logs/2019-11-24T12_01_11_331Z-debug.log
AlbertGao@Albert-LottoNZ-Laptop prisma2-ts-graphql-auth % npm run build
> graphql-auth@ build /Users/AlbertGao/codes/temp/prisma2-ts-graphql-auth
> npm -s run clean && npm -s run generate && tsc
> Downloading darwin binary for query-engine [====================] 100%
Generating Photon.js to ./node_modules/@prisma/photon
Done in 2.70s
You should specify a configuration value for outputs in Nexus' makeSchema. Provide one to remove this warning.
src/context.ts:1:24 - error TS2307: Cannot find module '@generated/photon'.
1 import { Photon } from '@generated/photon'
~~~~~~~~~~~~~~~~~~~
src/types/Post.ts:6:7 - error TS2339: Property 'model' does not exist on type 'ObjectDefinitionBlock<"Post">'.
6 t.model.id()
~~~~~
src/types/Post.ts:9:7 - error TS2339: Property 'model' does not exist on type 'ObjectDefinitionBlock<"Post">'.
9 t.model.published()
~~~~~
src/types/Post.ts:10:7 - error TS2339: Property 'model' does not exist on type 'ObjectDefinitionBlock<"Post">'.
10 t.model.title()
~~~~~
src/types/Post.ts:11:7 - error TS2339: Property 'model' does not exist on type 'ObjectDefinitionBlock<"Post">'.
11 t.model.content()
~~~~~
src/types/Post.ts:12:7 - error TS2339: Property 'model' does not exist on type 'ObjectDefinitionBlock<"Post">'.
12 t.model.author()
~~~~~
src/types/User.ts:6:7 - error TS2339: Property 'model' does not exist on type 'ObjectDefinitionBlock<"User">'.
6 t.model.id()
~~~~~
src/types/User.ts:7:7 - error TS2339: Property 'model' does not exist on type 'ObjectDefinitionBlock<"User">'.
7 t.model.name()
~~~~~
src/types/User.ts:8:7 - error TS2339: Property 'model' does not exist on type 'ObjectDefinitionBlock<"User">'.
8 t.model.email()
~~~~~
src/types/User.ts:9:7 - error TS2339: Property 'model' does not exist on type 'ObjectDefinitionBlock<"User">'.
9 t.model.posts({ pagination: false })
~~~~~
Found 10 errors.
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! graphql-auth@ build: `npm -s run clean && npm -s run generate && tsc`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the graphql-auth@ build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/AlbertGao/.npm/_logs/2019-11-24T12_01_28_316Z-debug.log
AlbertGao@Albert-LottoNZ-Laptop prisma2-ts-graphql-auth %
Just
git clone
the latestprisma-examples
Go to
typescript/graphql-auth
orgraphql-apollo-server
,run
npm i
Round 1
error:
In https://github.com/prisma/photonjs/issues/56 , it mentioned https://github.com/prisma/photonjs/pull/143 should fix it, I saw that merge, and there is no output in this
schema.prisma
, but still not working.I already global installed
prisma2
. but still not working.I am using Node v13.2.0, tried
12.13.0
without any luck.Tried adding
@prisma/photon
andprisma2
to devDependencies, still not work. Error is different though.=======================================
Round 2
After
git reset --hard
andrm -rf ./node_modules
I updated the prisma2 version in this project to
2.0.0-alpha.351
: it asks me to install an@prisma/photon
now! Exciting! But still error. :(and I am using
NPM
but the command seems to useyarn
?====================================
Round 3
After
git reset --hard
andrm -rf ./node_modules
This time I use
yarn install
with2.0.0-alpha.351
Error :( ......
Interesting, because ts-node is in the devDep, or is it the command it tried to run?
=====================
I think Round 3 is close? If that is the case, can we use
npm
or have to useyarn
?I think the easy way to solve it is to update the dep list in
package.json
? To include the@prisma/photon
?What am I missing? Thanks :)