# For python:
ros2 pkg create --build-type ament_python --node-name my_node my_package
# For cmake:
ros2 pkg create --build-type ament_cmake --node-name my_node my_package
# p.s. Make sure you have sourced ros2. (e.g. `source /opt/ros/foxy/local_setup.bash`)