Your check engine light means that there is an error code stored that will tell you where the issue is. Nissans will go into a "limp home" mode that limits the engine RPM if certain codes are detected to allow you to drive the vehicle to a safe location before shutting it off. I'm assuming this is what has happened with your vehicle.
You need to plug an OBDII code reader into the plug located somewhere under your dash near the steering column and find out what the error code stored is, then do a search on that code to find out what error it represents, then on that code and your specific vehicle to find more information.