How to set default time zone in Nestjs? - nestjs

I tried below script but it didn't work.
{
"scripts": {
"start": "TZ='UTC' nest start"
}
}
[System Information]
OS Version : Linux 5.4
NodeJS Version : v12.18.3
NPM Version : 6.14.6
[Nest CLI]
Nest CLI Version : 7.4.1
[Nest Platform Information]
platform-express version : 7.0.0
passport version : 7.0.0
typeorm version : 7.1.0
common version : 7.0.0
config version : 0.5.0
core version : 7.0.0
jwt version : 7.0.0

In a REPL, this is working as expected.
TZ=UTC node
> d = new Date()
> d.toLocaleTimeString()
I would assume you need to set your start command as
"start": "TZ=UTC nest start"

Related

Running Ionic project using specific Node version

I am trying to run an Ionic project using Node version 14.18.3
I am using Volta to set this version for this one particular project
To do this I ran this command:
volta pin node#14
If I navigate to my project and run node -v then I see 14.18.3
When I try and build my project it fails and gives me an error that indicates that my node version is not 14
If I run ionic info then I see the following output. This shows that my node version is 16.13.1
Question - where is 16.13.1 coming from? How do I get Ionic to run using node 14?
Ionic:
Ionic CLI : 6.18.1 (/Users/chris/.volta/tools/image/packages/#ionic/cli/lib/node_modules/#ionic/cli)
Ionic Framework : ionic-angular 3.9.3
#ionic/app-scripts : 3.2.1
Cordova:
Cordova CLI : 9.0.0 (cordova-lib#9.0.1)
Cordova Platforms : android 9.0.0, ios 5.1.1
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 4.1.0, (and 17 other plugins)
Utility:
cordova-res : 0.15.4
native-run (update available: 1.5.0) : 0.3.0
System:
Android SDK Tools : 26.1.1 (/Users/chris/Library/Android/sdk)
ios-deploy : 1.10.0
ios-sim : 8.0.2
NodeJS : v16.13.1 (/Users/chris/.volta/tools/image/node/16.13.1/bin/node)
npm : 8.2.0
OS : macOS Monterey
Xcode : Xcode 13.2.1 Build version 13C100

NestJS: Cannot read property "'createObjectLiteralExpression'" of undefined

After upgrade to NestJS 8, I got this when run npm run start:dev
Error Cannot read property "'createObjectLiteralExpression'" of undefined
Any idea what went wrong?
[System Information]
OS Version : Linux 5.4
NodeJS Version : v12.19.0
NPM Version : 6.14.8
[Nest CLI]
Nest CLI Version : 8.1.1
[Nest Platform Information]
platform-socket.io version : 8.0.6
platform-express version : 8.0.6
microservices version : 8.0.6
websockets version : 8.0.6
schematics version : 8.0.2
passport version : 8.0.1
schedule version : 1.0.1
swagger version : 5.0.9
typeorm version : 8.0.2
testing version : 8.0.6
common version : 8.0.6
config version : 1.0.1
core version : 8.0.6
jwt version : 8.0.0
cli version : 8.1.1
I found the issue myself. Took me hours. TypeScript need to upgrade to v4+.
This is v4+ feature. Even though I read the NestJS V8 blog carefully, still I missed it.

How to fix "Error: Path "/__path__/__name#dasherize#if-flat" does not exist" in Angular

I work on a formation on a starter kit about Angular5 and I am in trouble at the moment of create a new component with this command : "npm run ng generate component component/exemple/user/userThumbnail"
I already try to search if someone had the same issues but was in vain.
Here is my Angular configuration :
Angular CLI: 1.6.0
Node: 10.15.3
Angular: 5.0.0
#angular/cli: 1.6.0
#angular-devkit/build-optimizer: 0.0.42
#angular-devkit/core: 7.3.8
#angular-devkit/schematics: 7.3.8
#ngtools/json-schema: 1.1.0
#ngtools/webpack: 1.9.0
#schematics/angular: 0.1.11
typescript: 2.4.2
webpack-concat-plugin: 1.4.2
webpack-dev-server: 2.9.7
webpack: 3.10.0
Here is the log of my error :
Error: Path "/__path__/__name#dasherize#if-flat__/__name#dasherize__.component.html" does not exist.
Path "/__path__/__name#dasherize#if-flat__/__name#dasherize__.component.html" does not exist.
I just want to create a component without any problems.
Thank for help.
UPDATE
I solved my problem with this command :
npm install #angular-devkit/schematics#0.0.45 #angular/cli --save

IONIC - Task 'cdvBuildDebug' not found in root project 'android'

I am getting issue while trying to generate android build
Task 'cdvBuildDebug' not found in root project 'android'.
Please find below my ionic cordova information
cli packages: (/usr/lib/node_modules)
#ionic/cli-utils : 1.19.2
ionic (Ionic CLI) : 3.20.0
global packages:
cordova (Cordova CLI) : 8.0.0
local packages:
#ionic/app-scripts : 3.1.9
Cordova Platforms : MyApplication android 7.0.0 browser 5.0.3 ios 4.5.4
Ionic Framework : ionic-angular 3.9.2
System:
Android SDK Tools : 26.1.1
Node : v8.11.1
npm : 5.6.0
OS : Linux 4.13
Environment Variables:
ANDROID_HOME : /home/user/Android/Sdk
Misc:
backend : pro
Let me know what's wrong with it
Thanks
got a work around to this
simply change buildscript in /android/build.gradle to this
buildscript {
repositories {
maven {
url "https://dl.bintray.com/android/android-tools"
}
}
}

Node_JS with Ionic isn't installing packages correctly

When I try to create a new Ionic project then it will install files in the main project folder. I'm using Windows 10, with the latest version of Ionic and Node_JS.
It looks like this:
It should be something like this, when creating a new project:
If someone who experienced similar problems could help me then it would be greatly appreciated.
Ionic info gives me this:
global packages:
#ionic/cli-utils : 1.0.0
Ionic CLI : 3.0.0
System:
Node : v6.10.3
OS : Windows 10
Xcode : not installed
ios-deploy : not installed
ios-sim : not installed

Resources