0

I followed these steps to build my first sailsjs MVC application:

  1. sudo apt-get install nodejs
  2. nodejs -v returns v0.10.25
  3. sudo apt-get install npm
  4. npm -v returns 1.3.10
  5. sudo npm install -g sails

After that i got following errors:

npm http GET https://registry.npmjs.org/sails
npm http 304 https://registry.npmjs.org/sails
npm WARN engine sails@0.11.3: wanted: {"node":">= 0.10.0","npm":">= 1.4.0"} (current: {"node":"v0.10.25","npm":"1.3.10"})

> sails@0.11.3 preinstall /usr/local/lib/node_modules/sails
> node ./lib/preinstall_npmcheck.js

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

npm ERR! weird error 127
npm ERR! not ok code 0
Lu Roman
  • 2,220
  • 3
  • 25
  • 40
andy
  • 525
  • 3
  • 6
  • 22

1 Answers1

5

Try sudo apt-get install nodejs-legacy , it seems debian maintainers renamed the package to that.

Also you are getting the warning in sails, because you have an unmet dependency version. If you check the error, where it states which version of npm it needs, it says "npm":">= 1.4.0" but you have the 1.3.10 version on your system. You need 1.4.0 or newer.

Try

sudo npm cache clean -f
sudo npm install -g n
sudo n stable

To see if that updates the npm

If that does not work, try reinstalling node with the repositories from nodeSource

sudo apt-get install curl
curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
sudo apt-get install -y nodejs

Change the 4.x to the desired node version, but i recommend you to install the latest one which is 4.1.0 (I know it works with sails)

I have ubuntu so i can't check, but that should work.

Also check the link below if none of the above worked (Not sure if your question can be considered duplicate)


Cannot install packages using node package manager in Ubuntu

Community
  • 1
  • 1
Lu Roman
  • 2,220
  • 3
  • 25
  • 40