SoftwareBrothers / adminjs

AdminJS is an admin panel for apps written in node.js
https://adminjs.co
MIT License
8.15k stars 659 forks source link

[Bug]: CustomError: Cannot find package 'typeorm' imported from /node_modules/@adminjs/typeorm/lib/Resource.js #1555

Closed wallet-official closed 11 months ago

wallet-official commented 1 year ago

Contact Details

No response

What happened?

List what you are trying to do?

Try to run the app, ts-node --esm app.ts

Bug prevalence

Always

AdminJS dependencies version

{ "name": "api-exp", "version": "0.0.0", "type": "module", "private": true, "scripts": { "start": "ts-node ./bin/www" }, "dependencies": { "@adminjs/express": "^6.0.0", "@adminjs/mongoose": "^4.0.0", "@adminjs/typeorm": "^5.0.0", "adminjs": "^7.2.1", "cookie-parser": "~1.4.4", "debug": "~2.6.9", "express": "^4.18.2", "express-formidable": "^1.2.0", "express-session": "^1.17.3", "http-errors": "~1.6.3", "jade": "~1.11.0", "mongoose": "^7.5.0", "morgan": "~1.9.1", "tslib": "^2.6.2" }, "devDependencies": { "@adminjs/typeorm": "^5.0.0", "@tsconfig/recommended": "^1.0.2", "@types/express": "^4.17.17" } }

What browsers do you see the problem on?

Chrome

Relevant log output

Debugger attached.
Debugger attached.
/usr/local/lib/node_modules/ts-node/dist-raw/node-internal-modules-esm-resolve.js:757
  throw new ERR_MODULE_NOT_FOUND(packageName, fileURLToPath(base));
        ^
CustomError: Cannot find package 'typeorm' imported from /home/ec2-user/tutorial/node_modules/@adminjs/typeorm/lib/Resource.js
    at packageResolve (/usr/local/lib/node_modules/ts-node/dist-raw/node-internal-modules-esm-resolve.js:757:9)
    at moduleResolve (/usr/local/lib/node_modules/ts-node/dist-raw/node-internal-modules-esm-resolve.js:798:18)
    at Object.defaultResolve (/usr/local/lib/node_modules/ts-node/dist-raw/node-internal-modules-esm-resolve.js:912:11)
    at /usr/local/lib/node_modules/ts-node/src/esm.ts:218:35
    at entrypointFallback (/usr/local/lib/node_modules/ts-node/src/esm.ts:168:34)
    at /usr/local/lib/node_modules/ts-node/src/esm.ts:217:14
    at addShortCircuitFlag (/usr/local/lib/node_modules/ts-node/src/esm.ts:409:21)
    at resolve (/usr/local/lib/node_modules/ts-node/src/esm.ts:197:12)
    at resolve (/usr/local/lib/node_modules/ts-node/src/child/child-loader.ts:15:39)
    at nextResolve (node:internal/modules/esm/loader:163:28)
Waiting for the debugger to disconnect...


### Relevant code that's giving you issues

_No response_
dziraf commented 11 months ago

You're missing typeorm in your dependencies

wallet-official commented 11 months ago

thanks boss, upon check there is a typeorm in the package.json. I thought it's cache, so that i create a new project, the message missing.