-
Notifications
You must be signed in to change notification settings - Fork 657
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
npm run start:prod error #18
Comments
Try this: In {
...
"scripts": {
"start": "NODE_ENV=development node index.js",
"start:watch": "NODE_ENV=development nodemon",
"start:prod": "NODE_ENV=production node dist/src/main.js",
}
...
} Change module.exports = {
"type": "mysql",
"host": "localhost",
"port": 3306,
"username": "...",
"password": "...",
"database": "...",
"entities": [ process.env.NODE_ENV == 'production' ? __dirname + '/dist/src/**/**.entity.js' : __dirname + '/src/**/**.entity.ts' ],
"migrationsTableName": "migrations",
"migrations": ["database/migration/*.js"],
"cli": {
"migrationsDir": "database/migration"
},
"synchronize": true
} |
+1 any else answers? |
it works.Just remember to modify the workspace. |
I want to start prod this following error.
[Nest] 92672 - 2019-06-09 09:49 [NestFactory] Starting Nest application...
[Nest] 92672 - 2019-06-09 09:49 [InstanceLoader] TypeOrmModule dependencies initialized +131ms
[Nest] 92672 - 2019-06-09 09:49 [TypeOrmModule] Unable to connect to the database. Retrying (1)... +105ms
/Users/lee/Sites/demo/nestjs-realworld-example-app/src/article/article.entity.ts:1
(function (exports, require, module, __filename, __dirname) { import { Entity, PrimaryGeneratedColumn, Column, OneToOne, ManyToOne, OneToMany, JoinColumn, AfterUpdate, BeforeUpdate } from 'typeorm';
^^^^^^
SyntaxError: Unexpected token import
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:616:28)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Function.PlatformTools.load (/Users/lee/Sites/demo/nestjs-realworld-example-app/node_modules/_typeorm@0.2.18@typeorm/platform/PlatformTools.js:107:28)
[Nest] 92672 - 2019-06-09 09:49 [TypeOrmModule] Unable to connect to the database. Retrying (2)... +3025ms
/Users/lee/Sites/demo/nestjs-realworld-example-app/src/article/article.entity.ts:1
(function (exports, require, module, __filename, __dirname) { import { Entity, PrimaryGeneratedColumn, Column, OneToOne, ManyToOne, OneToMany, JoinColumn, AfterUpdate, BeforeUpdate } from 'typeorm';
The text was updated successfully, but these errors were encountered: