01-cats-app - npm run start:prod
See original GitHub issueHello
I have created a repo I have built typeorm - jest - class-validator - passport all is fine but when I run the command “npm run start: prod” the following error message appears, I thought that this is a bad configuration but I tested the command in the application “01-cats-app” but the error always appears
E:\Projets\WebStorm\01-cats-app\01-cats-app>npm run start:prod
> nest-typescript-starter@1.0.0 prestart:prod E:\Projets\WebStorm\01-cats-app\01-cats-app
> tsc
node_modules/@types/jest/index.d.ts(14,13): error TS2300: Duplicate identifier 'beforeEach'.
node_modules/@types/jest/index.d.ts(16,13): error TS2300: Duplicate identifier 'afterEach'.
node_modules/@types/mocha/index.d.ts(33,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'describe' must be of type 'Describe', but here has type 'IContextDefinition'.
node_modules/@types/mocha/index.d.ts(34,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'xdescribe' must be of type 'Describe', but here has type 'IContextDefinition'.
node_modules/@types/mocha/index.d.ts(39,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'it' must be of type 'It', but here has type 'ITestDefinition'.
node_modules/@types/mocha/index.d.ts(40,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'xit' must be of type 'It', but here has type 'ITestDefinition'.
node_modules/@types/mocha/index.d.ts(42,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'test' must be of type 'It', but here has type 'ITestDefinition'.
node_modules/@types/mocha/index.d.ts(60,18): error TS2300: Duplicate identifier 'beforeEach'.
node_modules/@types/mocha/index.d.ts(61,18): error TS2300: Duplicate identifier 'beforeEach'.
node_modules/@types/mocha/index.d.ts(62,18): error TS2300: Duplicate identifier 'afterEach'.
node_modules/@types/mocha/index.d.ts(63,18): error TS2300: Duplicate identifier 'afterEach'.
thanks for help
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:11 (1 by maintainers)
Top Results From Across the Web
create-react-app npm run start in production mode. Maybe ...
The best option is probably to do a normal production build and then run it locally. First install an HTTP server: npm install...
Read more >npm-start
This runs a predefined command specified in the "start" property of a package's "scripts" object. If the "scripts" object does not define a...
Read more >➫ How to npm run start at the background ⭐️ | by Ido ...
How to npm run start at the background ⭐️. So I have a (Vue/Angular/React).JS web application and I need to run it in...
Read more >Getting Started - Razzle
npm run start:prod#. Runs the compiled app in production. You can again view your application at http://localhost:3000. npm test ...
Read more >Create a New React App
npx create-react-app my-app cd my-app npm start ... When you're ready to deploy to production, running npm run build will create an optimized...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I found the problem.
It’s related to TypeORM’s ormconfig.json. By default it looks for entities in the
/src
folder and opens TypeScript files instead of the Javascript compiled ones.The solution I found was using a dynamic ormconfig.js (instead of .json) that has a conditional path. Docs here => http://typeorm.io/#/using-ormconfig/loading-from-ormconfigjs
In my case my ormconfig.js looks like that (assuming that you have a dotenv variable called NODE_ENV) :
For everyone that gets this error in the examples, look in the
ormconfig.json
file, it looks for entities in the src directory.When you run
npm run start:prod
the entities will be in the dist directory.