Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using pnpm to install dependencies cannot start the project, using yarn is ok #12246

Closed
2 of 15 tasks
TinsFox opened this issue Aug 20, 2023 · 8 comments
Closed
2 of 15 tasks
Labels
needs triage This issue has not been looked into

Comments

@TinsFox
Copy link

TinsFox commented Aug 20, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

project failed to start

image

Minimum reproduction code

https://github.com/nestjs/nest/tree/master/sample/27-scheduling

Steps to reproduce

  1. pnpm i
  2. pnpm start

Expected behavior

I hope he can work

Package

  • 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

No response

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": {
    "@nestjs/common": "10.0.3",
    "@nestjs/core": "10.0.3",
    "@nestjs/platform-express": "10.0.3",
    "@nestjs/schedule": "3.0.1",
    "dotenv": "16.3.1",
    "reflect-metadata": "0.1.13",
    "rimraf": "5.0.1",
    "rxjs": "7.8.1"
  },
  "devDependencies": {
    "@nestjs/cli": "10.0.5",
    "@nestjs/schematics": "10.0.1",
    "@nestjs/testing": "10.0.3",
    "@types/bull": "3.15.9",
    "@types/dotenv": "8.2.0",
    "@types/express": "4.17.17",
    "@types/jest": "29.5.3",
    "@types/node": "20.3.3",
    "@types/supertest": "2.0.12",
    "jest": "29.6.1",
    "prettier": "2.8.8",
    "supertest": "6.3.3",
    "ts-jest": "29.1.1",
    "ts-loader": "9.4.4",
    "ts-node": "10.9.1",
    "tsconfig-paths": "4.2.0",
    "@typescript-eslint/eslint-plugin": "5.60.1",
    "@typescript-eslint/parser": "5.60.1",
    "eslint": "8.42.0",
    "eslint-config-prettier": "8.8.0",
    "eslint-plugin-import": "2.27.5",
    "typescript": "5.1.6"
  },
  "jest": {
    "moduleFileExtensions": [
      "js",
      "json",
      "ts"
    ],
    "rootDir": "src",
    "testRegex": ".*\\.spec\\.ts$",
    "transform": {
      "^.+\\.(t|j)s$": "ts-jest"
    },
    "coverageDirectory": "../coverage",
    "testEnvironment": "node"
  }
}

Node.js version

v18.15.0

In which operating systems have you tested?

  • macOS
  • Windows
  • Linux

Other

[email protected]

@TinsFox TinsFox added the needs triage This issue has not been looked into label Aug 20, 2023
@Tony133
Copy link
Contributor

Tony133 commented Aug 20, 2023

I use pnpm v8.6.12 the latest released version is working perfectly ( see screenshot ), have you tried to update the version of pnpm ?
pnpm-install

@TinsFox
Copy link
Author

TinsFox commented Aug 21, 2023

Hi @Tony133 , thank you for your reply.

It is indeed possible to use [email protected]

@TinsFox TinsFox closed this as completed Aug 21, 2023
@TinsFox
Copy link
Author

TinsFox commented Aug 21, 2023

Hey @Tony133

I tried to create a new nestjs project, followed the steps in the documentation to add task scheduling and failed when the project started

👇 Here is the minimal repo:
https://github.com/TinsFox/task-scheduling-pnpm

git clone [email protected]:TinsFox/task-scheduling-pnpm.git
cd task-scheduling-pnpm
pnpm install
pnpm start

The error shown in the figure below appears

image

@TinsFox TinsFox reopened this Aug 21, 2023
@TinsFox
Copy link
Author

TinsFox commented Aug 21, 2023

I also found a problem. In the example, there is no @types/cron dependency, but it needs to be installed in the document. which is correct

image image

@TinsFox
Copy link
Author

TinsFox commented Aug 21, 2023

Hi @Tony133 , thank you for your reply.

It is indeed possible to use [email protected]

This is only valid for https://github.com/nestjs/nest/tree/master/sample/27-scheduling

@kamilmysliwiec
Copy link
Member

Would you like to create a PR for this issue?

@Tony133
Copy link
Contributor

Tony133 commented Aug 21, 2023

I also found a problem. In the example, there is no @types/cron dependency, but it needs to be installed in the document. which is correct

image image

@TinsFox verifying actually there would be no need for this @types/cron dependency anymore because it's deprecated (see here:https://www.npmjs.com/package/@types/cron) so the documentation should be updated.

In fact it should also be removed from the @nestjs/schedule package, there is a PR here: nestjs/schedule#1374 , only that it has conflicts and cannot be merged.

As for the error, maybe there's something inside the @nestjs/schedule package that's not working, but I still need to check.

@kamilmysliwiec
Copy link
Member

nestjs/schedule#1374

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage This issue has not been looked into
Projects
None yet
Development

No branches or pull requests

3 participants