After I installed the chaincode, the peer chaincode list return all installed chaincode with the id numbers:
peer chaincode list --installed -C mychannel
Get installed chaincodes on peer:
Name: dev-mychaincode-cc, Version: alpha1, Path: /opt/home/mychaincode-cc, Id: 414955ccc11a2644a7f7caxxxb29ee06
Is there anyway to get this id (414955ccc11a2644a7f7caxxxb29ee06) by Hyperledger Fabric SDK for node.js?
You should be able to call the GetInstalledChaincodes transaction function on the lscc system chaincode, and parse the return value, which is a ChaincodeQueryResponse protocol buffer (protobuf) message.
The protobuf definitions for Fabric are in the fabric-protos repository. There are also published Go, Node (TypeScript/JavaScript) and Java language bindings for all the Fabric protobufs that you can use directly to help unpack protobuf messages:
https://hyperledger.github.io/fabric-protos/
For reference, the lscc chaincode's GetAllChaincodes transaction function implementation is here: