5

After I npm installed Sails.js on Windows 10, "sails" command is not recognized.

Can someone give me a hint on what values to use in the PATH variable? As I understand it is Node.exe that runs the sails.js file. But if I try tunning "node sails.js" command in cmd, it recognizes it, but can't find some of the dependencies.

On my Windows 7 machine everything installed and is running like a charm

kunal soni
  • 585
  • 1
  • 7
  • 19
  • I don't think `node sails.js` is the intended use. You either use `sails lift` or `node app.js` (I believe that command is what `sails lift` uses under the hood) – arbuthnott Sep 26 '17 at 11:08
  • i m following this steps where sails lift is important to use after node app.......MongoDB & NodeJS on same host Download and install NodeJS Download and install MongoDB Run Mongo daemon Open Console Navigate to MongoDB folder Run mongod Download ExtentX, unzip, navigate to its folder and run: npm install sails lift Open browser and navigate to the NodeJS server URL + port. Ex: localhost:1337,..........................................for more info http://extentreports.com/docs/extentx/ – kunal soni Sep 26 '17 at 11:13

1 Answers1

0

I am not sure how you installed sails, but as I do not have enough reputation to post a comment I am writing this as an answer.

So did you install sails globally? Which command you used while installing sails

npm -g install sails

OR

npm install sails 

You should use

npm -g install sails 

Edit

Could you follow the below steps in command prompt with administrator rights.

npm cache clear

Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force
npm install -g npm-windows-upgrade
npm-windows-upgrade

npm -g install sails

Let me know if you still face the issue.

TGW
  • 805
  • 10
  • 27
  • it works successfully but after then when i go and fire command "sails lift"............................it throws error like this.... C:\Users\XXXXXXXX\AppData\Roaming\npm\node_modules\sails\bin\sails.js module.js:473 throw err; ^ – kunal soni Sep 26 '17 at 09:54
  • no I mean which one of the 2 I mentioned did you use? Both are going to show you a success message but which one did you exactly use? – TGW Sep 26 '17 at 10:00
  • if i used npm install sails ............it throws error like ....... C:\Users\Kunal\Downloads\extentx-community-1.0.2>npm install sails npm WARN deprecated native-or-bluebird@1.1.2: 'native-or-bluebird' is deprecated. Please use 'any-promise' instead. npm WARN mongodb-core@1.2.31 requires a peer of kerberos@~0.0 but none was installed. – kunal soni Sep 26 '17 at 10:15
  • I see some version issues could you check the edit I provided in my answer and see if that works? – TGW Sep 26 '17 at 10:28
  • only npm install -g npm-windows-upgrade this command is working and all others are throwing issue. and at the end of all commands it throws issues. – kunal soni Sep 26 '17 at 11:03
  • Okay no worries, now would you try npm -g install sails I think your version was having some issues this must be fixed now as you said upgrade command worked – TGW Sep 26 '17 at 11:55
  • Also if something throws error please mention those errors – TGW Sep 26 '17 at 11:56
  • i have fire the command it displays same errors.....................C:\Users\Kunal\Downloads\extentx-community-1.0.2>node C:\Users\XXXXXXXX\AppData\Roaming\npm\node_modules\sails\bin\sails.js module.js:473 throw err; ^ Error: Cannot find module 'C:\Users\XXXXXXXX\AppData\Roaming\npm\node_modules\sails\bin\sails.js' at Function.Module._resolveFilename (module.js:527:15) at Function.Module._load (module.js:453:25) at Function.Module.runMain (module.js:665:10) at startup (bootstrap_node.js:201:16) at bootstrap_node.js:626:3 – kunal soni Sep 26 '17 at 12:18
  • C:\Users\XXXXXX\AppData\Roaming\npm can you put this as your PATH variable ? – TGW Sep 26 '17 at 12:22