SHARE
TWEET

Untitled

a guest May 1st, 2018 220 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # here i'm in my home dir, and try to run "npm outdated", as of course will fail as it should be run from the ~/.node-red folder...
  2. [pi@mylinux] ~
  3. $ npm outdated
  4.  
  5. # then i created an alias that FIRST changes to the right directory, THEN runs npm, with whatever option you pass to it, of course...
  6. [pi@mylinux] ~
  7. $ alias npm="cd ~/.node-red;npm "
  8.  
  9. # so if i now AGAIN, from my HOME dir, run the same command, it works :)
  10. [pi@mylinux] ~
  11. $ npm outdated
  12. Package                    Current  Wanted  Latest  Location
  13. i2c-bus                      3.1.0   3.2.0   3.2.0  pi
  14. moment                      2.22.0  2.22.1  2.22.1  pi
  15. node-red-contrib-bigtimer    1.8.1   1.8.1   1.9.2  pi
  16. node-red-contrib-chatbot    0.10.3  0.10.3  0.12.2  pi
  17. node-red-dashboard           2.9.0   2.9.1   2.9.1  pi
  18.  
  19. # and you're left in the ~/.node-red folder so you can do other commands, of course... you can see it from the prompt and with the "pwd" command
  20. [pi@mylinux] ~/.node-red
  21. $ pwd
  22. /home/pi/.node-red
  23.  
  24. # for example using NCU to check for updates (install it with "sudo npm i -g npm-check-updates"):
  25. [pi@mylinux] ~/.node-red
  26. $ ncu -u
  27. Using /home/pi/.node-red/package.json
  28. [..................] | :
  29.  node-red-contrib-bigtimer   ~1.8.1  →   ~1.9.2
  30.  node-red-contrib-chatbot   ~0.10.3  →  ~0.12.2
  31.  i2c-bus              ^3.1.0  →   ^3.2.0
  32.  moment              ^2.18.1  →  ^2.22.1
  33.  node-red-dashboard   ~2.9.0  →   ~2.9.1
  34.  
  35. Upgraded /home/pi/.node-red/package.json
  36.  
  37. # after NCU has updated your package.json, you can use npm install to update to latest packages versions
  38. [pi@mylinux] ~/.node-red
  39. $ npm -s install
  40. pi@1.0.0 /home/pi/.node-red
  41. +-- node-red-contrib-bigtimer@1.9.2
  42. `-- node-red-contrib-chatbot@0.12.2
  43.   +-- @slack/client@3.16.0
  44.   | +-- lodash@4.17.10
  45.   | `-- winston@2.4.2
  46.   +-- node-telegram-bot-api@0.30.0
  47.   | `-- eventemitter3@3.1.0
  48.   +-- prettyjson@1.2.1
  49.   | `-- colors@1.2.3
  50.   `-- underscore@1.9.0
  51. +-- i2c-bus@3.2.0
  52. +-- moment@2.22.1
  53. `-- node-red-dashboard@2.9.1
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top