nest icon indicating copy to clipboard operation
nest copied to clipboard

Docs Improvements: Samples Node Version

Open igordonin opened this issue 1 year ago • 1 comments
trafficstars

Is there an existing issue for this?

  • [X] I have searched the existing issues

Current behavior

How does anyone know in which version of Node are the samples supposed to run? That info is not in the docs and the there's no .nvmrc

Minimum reproduction code

https://github.com/nestjs/nest/tree/master/sample/23-graphql-code-first/

Steps to reproduce

npm i

Expected behavior

I'd expect npm to install the packages, but I get errors

npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: @nestjs/[email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/reflect-metadata
npm ERR!   reflect-metadata@"0.2.1" from the root project
npm ERR!   peer reflect-metadata@"^0.1.12 || ^0.2.0" from @nestjs/[email protected]
npm ERR!   node_modules/@nestjs/common
npm ERR!     @nestjs/common@"10.3.2" from the root project
npm ERR!     peer @nestjs/common@"^9.3.8 || ^10.0.0" from @nestjs/[email protected]
npm ERR!     node_modules/@nestjs/apollo
npm ERR!       @nestjs/apollo@"12.0.11" from the root project
npm ERR!     5 more (@nestjs/core, @nestjs/graphql, @nestjs/mapped-types, ...)
npm ERR!   1 more (@nestjs/core)

Package

  • [X] I don't know. Or some 3rd-party package
  • [ ] @nestjs/common
  • [ ] @nestjs/core
  • [ ] @nestjs/microservices
  • [ ] @nestjs/platform-express
  • [ ] @nestjs/platform-fastify
  • [ ] @nestjs/platform-socket.io
  • [ ] @nestjs/platform-ws
  • [ ] @nestjs/testing
  • [ ] @nestjs/websockets
  • [ ] Other (see below)

Other package

No response

NestJS version

10.3.2

Packages versions

{
  "name": "nest-typescript-starter",
  "version": "1.0.0",
  "description": "Nest TypeScript starter repository",
  "license": "MIT",
  "scripts": {
    "prebuild": "rimraf dist",
    "build": "nest build",
    "format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
    "start": "nest start",
    "start:dev": "nest start --watch",
    "start:debug": "nest start --debug --watch",
    "start:prod": "node dist/main",
    "lint": "eslint '{src,apps,libs,test}/**/*.ts' --fix",
    "test": "jest",
    "test:watch": "jest --watch",
    "test:cov": "jest --coverage",
    "test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
    "test:e2e": "echo 'No e2e tests implemented yet.'"
  },
  "dependencies": {
    "@apollo/server": "4.9.3",
    "@nestjs/apollo": "12.0.11",
    "@nestjs/common": "10.3.2",
    "@nestjs/core": "10.3.2",
    "@nestjs/graphql": "12.0.11",
    "@nestjs/platform-express": "10.3.2",
    "class-transformer": "0.5.1",
    "class-validator": "0.14.1",
    "graphql": "16.8.1",
    "graphql-query-complexity": "0.12.0",
    "graphql-subscriptions": "2.0.0",
    "reflect-metadata": "0.2.1",
    "rxjs": "7.8.1"
  },
  "devDependencies": {
    "@nestjs/cli": "10.3.2",
    "@nestjs/schematics": "10.1.1",
    "@nestjs/testing": "10.3.2",
    "@types/express": "4.17.21",
    "@types/node": "20.8.7",
    "@types/supertest": "2.0.16",
    "@typescript-eslint/eslint-plugin": "5.62.0",
    "@typescript-eslint/parser": "5.62.0",
    "eslint": "8.42.0",
    "eslint-config-prettier": "9.1.0",
    "eslint-plugin-import": "2.29.1",
    "jest": "29.7.0",
    "prettier": "3.2.5",
    "supertest": "6.3.3",
    "ts-jest": "29.1.2",
    "ts-loader": "9.5.1",
    "ts-node": "10.9.2",
    "tsconfig-paths": "4.2.0",
    "typescript": "5.3.3"
  }
}

Node.js version

20.12.2

In which operating systems have you tested?

  • [X] macOS
  • [ ] Windows
  • [ ] Linux

Other

No response

igordonin avatar May 03 '24 11:05 igordonin

that's not a issue with nodejs but a dep mismatch. I guess Renovatebot will fix that

It will work if you use the latest version of @nestjs/graphql

micalevisk avatar May 03 '24 23:05 micalevisk

Yup, not suggesting it's a bug, just that having a .nvmrc with the node version would likely help with the correct dependencies versions. But yeah, updating dependencies versions fixed it. Thanks for your response.

igordonin avatar May 04 '24 11:05 igordonin