adam-cowley / nestjs-neo4j-starter

A starter kit for Nest.js and Neo4j
9 stars 2 forks source link

how to run the project.? npm run start:dev it is not working. #2

Closed delkant closed 2 years ago

delkant commented 2 years ago

I am trying to run this starter project but keep getting same errors: npm run start:dev

`node_modules/nest-neo4j/dist/neo4j.service.d.ts:10:32 - error TS2307: Cannot find module 'neo4j-driver/types/integer' or its corresponding type declarations.

10 int(value: number): import("neo4j-driver/types/integer").default;


node_modules/nest-neo4j/dist/neo4j.service.d.ts:12:47 - error TS2307: Cannot find module 'neo4j-driver/types/session' or its corresponding type declarations.

12     getReadSession(database?: string): import("neo4j-driver/types/session").default;

node_modules/nest-neo4j/dist/neo4j.service.d.ts:13:48 - error TS2307: Cannot find module 'neo4j-driver/types/session' or its corresponding type declarations.

13 getWriteSession(database?: string): import("neo4j-driver/types/session").default;



[10:31:46 PM] Found 3 errors. Watching for file changes.`
adam-cowley commented 2 years ago

That looks like the the neo4j driver dependency is missing, try running

npm install --save neo4j-driver
delkant commented 2 years ago

Thanks for the reply! neo4j-driver was included, not sure if a different version is required though. I have the same issues in all your projects where nestjs and neo4j are installed together.

This is how my package.json looks like:

{
  "name": "neo4j-nest-starter",
  "version": "0.0.1",
  "description": "",
  "author": "",
  "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": "jest --watch --config ./test/jest-e2e.json"
  },
  "dependencies": {
    "@nestjs/common": "^7.0.0",
    "@nestjs/config": "^0.5.0",
    "@nestjs/core": "^7.0.0",
    "@nestjs/jwt": "^7.1.0",
    "@nestjs/passport": "^7.1.0",
    "@nestjs/platform-express": "^7.0.0",
    "bcrypt": "^5.0.0",
    "class-transformer": "^0.3.1",
    "class-validator": "^0.12.2",
    "neo4j-driver": "^4.4.1",
    "nest-neo4j": "^0.1.4",
    "passport": "^0.4.1",
    "passport-jwt": "^4.0.0",
    "passport-local": "^1.0.0",
    "reflect-metadata": "^0.1.13",
    "rimraf": "^3.0.2",
    "rxjs": "^6.5.4"
  },
  "devDependencies": {
    "@nestjs/cli": "^7.0.0",
    "@nestjs/schematics": "^7.0.0",
    "@nestjs/testing": "^7.0.0",
    "@types/express": "^4.17.3",
    "@types/jest": "25.2.3",
    "@types/node": "^13.9.1",
    "@types/supertest": "^2.0.8",
    "@typescript-eslint/eslint-plugin": "3.0.2",
    "@typescript-eslint/parser": "3.0.2",
    "eslint": "7.1.0",
    "eslint-config-prettier": "^6.10.0",
    "eslint-plugin-import": "^2.20.1",
    "jest": "26.0.1",
    "prettier": "^1.19.1",
    "supertest": "^4.0.2",
    "ts-jest": "26.1.0",
    "ts-loader": "^6.2.1",
    "ts-node": "^8.6.2",
    "tsconfig-paths": "^3.9.0",
    "typescript": "^3.7.4"
  },
  "jest": {
    "moduleFileExtensions": [
      "js",
      "json",
      "ts"
    ],
    "rootDir": "src",
    "testRegex": ".spec.ts$",
    "transform": {
      "^.+\\.(t|j)s$": "ts-jest"
    },
    "coverageDirectory": "../coverage",
    "testEnvironment": "node"
  }
}
adam-cowley commented 2 years ago

It looks like some of the internals of the driver have been moved to another repo, I have just published version 0.1.5 of nest-neo4j. If you run this you should be fine:

npm i --save nest-neo4j
delkant commented 2 years ago

That worked. Thanks, closing the issue.