Tx hash: undefined. Web3 error on command prompt

`    var Tx = require('ethereumjs-tx').Transaction`
`    var Web3 = require('web3')`
`    web3 = new Web3('https://ropsten.infura.io/hqRzEqFKv6IsjRxfVUMH')`
`    const account1 = '0x0539B9c9C886e93778542B553C64cb5EAfB902b1'`
`    const account2 = '0xca7F442c44b079dd07324C9c7eDfe348b92f46c9'`
`    const privatekey1 = Buffer.from('cxxxxxxxxxxxxx5xd0804xxxxxxx238ca1aed1xxx' , 'hex')`
`    web3.eth.getTransactionCount(account1 , (err, transCount) => {`
`    const txObject = {`
`    nonce: web3.utils.toHex(transCount) ,`
`    to: account2 ,`
`    value: web3.utils.toHex(web3.utils.toWei('1' , 'ether')) ,`
`    gasLimit: web3.utils.toHex(30000) ,`
`    gasPrice: web3.utils.toHex(web3.utils.toWei('10' , 'gwei'))`
`    }`
`    var tx = new Tx(txObject)`
`    tx.sign(privatekey1)`
`    const serializedTransaction = tx.serialize()`
`    const raw = '0x' + serializedTransaction.toString('hex')`
`    web3.eth.sendSignedTransaction(raw , (err, txHash) => `
`    {console.log('txHash: ' , txHash)})`
`    })`

I tried this code to send test ether to my other account. The problem here is that when I run this code from the command prompt, this outputs:
txHash: undefined.
I’ve tried everything I can, but nothing changed. I suspect that the problem is in the infura nerwork link, but I’m not sure. Note the transaction doesn’t even happen.

Hi @Abdulrahman_Hozayen are you getting any additional error output?

Sometimes I get this error when I run the code in windows command prompt:
UnhandledPromiseRejectionWarning

It appears you’re using a deprecated API key, if you haven’t already, please create an account at infura.io and generate new project credentials.

Can you try sending your request with the new project credentials?