Hi,
I’m trying to install Keystone.js which as a pre-requisite, requires installation of both Node and MongoDB, so I followed the following posts to do so:
https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-an-ubuntu-14-04-server https://www.digitalocean.com/community/tutorials/how-to-install-mongodb-on-ubuntu-14-04
This has installed a ‘stable’ version of NodeJS on my server. However, when I then install keystone with the following commands:
npm install -g generator-keystone
and create a directory:
mkdir test-directory
cd test-directory
I’m required to run the generator
yo keystone
which returns:
yo: command not found
Searching around, it’s cleary that perhaps my PATH wasn’t exported:
export PATH="$PATH":~/.node/bin
but that doesn’t fix the issue. So I decided to follow the advice of the last post here instead, which uninstalls grunt and yo, and reinstalls yo:
http://stackoverflow.com/questions/24026166/yo-command-not-found
But after uninstalling both packages, I’m now faced with this error upon reinstalling just yo:
sh: 1: node: not found
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian
How do I resolve this?
For reference, the Keystone documentation is here for installation - http://keystonejs.com/getting-started/
It is probably related to a shift in commands from one version of node to the other, so perhaps I should be installing a specific version of node instead?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hey there,
If you installed node.js with sudo apt-get install nodejs on Ubuntu, you will have the binary named nodejs and not node which may be the reason for your error message.
If this is your issue, you could install node via the PPA here.
To test if node is installed and in your path, you can run node -v and you should get a version number returned, for example:
sammy@ubuntu $ node -v
v7.2.0
After you have resolved the node “command not found” issue, you should be able to install yeoman system-wide:
sudo npm install -g yo
You can then check your yo installation:
sammy@ubuntu $ yo --version
1.8.5
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.