Do you make sure below steps are performed.
Download and npm package
Install NodeJS Long Term Support (LTS) v4.x.x version.
After installing node, make sure you are running V3 of npm by running the following command:
npm install -g npm@3
Install windows build tools.
npm install -g --production windows-build-tools
Enter the following command to install Yeoman and gulp:
npm install -g yo gulp
Enter the following command to install the Yeoman SharePoint generator:
npm install -g @microsoft/generator-sharepoint
If there are any errors in above steps it means your development environment is not setup correctly