How to install Node.js ?
Tofloor
poster avatar
mike235
deepin
2017-11-30 03:01
Author
Following the official installation instructions of Nodejs, I get the following error :

  1. mike@solaris:~/bin$ curl -sL https://deb.nodesource.com/setup_9.x | sudo -E bash -

  2. ## Installing the NodeSource Node.js v9.x repo...


  3. ## Populating apt-get cache...

  4. + apt-get update
  5. Hit:1 https://repo.skype.com/deb stable InRelease
  6. Hit:2 https://deb.opera.com/opera-stable stable InRelease
  7. Get:3 http://packages.deepin.com/deepin panda InRelease [11.4 kB]
  8. Fetched 11.4 kB in 3s (3,126 B/s)   
  9. Reading package lists... Done

  10. ## Confirming "unstable" is supported...

  11. + curl -sLf -o /dev/null 'https://deb.nodesource.com/node_9.x/dists/unstable/Release'

  12. ## Your distribution, identified as "unstable", is not currently supported, please contact NodeSource at https://github.com/nodesource/distributions/issues if you think this is incorrect or would like your distribution to be considered for support
Copy the Code


BTW, is there an reason as to why Deepin is based on Debian Unstable ???
Reply Favorite View the author
All Replies
azs
deepin
2017-11-30 03:37
#1
you can add nodejs repo file to deepin /etc/apt/source.list.d/
eg:


  1. #SuperUser:
  2. sudo -s
  3. #Add nodejs repo file to system:
  4. echo -e "deb https://deb.nodesource.com/node_8.x stretch main \ndeb-src https://deb.nodesource.com/node_8.x stretch main" > /etc/apt/sources.list.d/nodesource.list
  5. # Update
  6. apt update
  7. # Install Nodejs
  8. apt install nodejs
Copy the Code

Finished, Good Lucky!
Reply View the author
ti******[email protected]
deepin
2017-11-30 05:07
#2
Or you could use NVM, that way you can easily change your Node version.

https://github.com/creationix/nvm
Reply View the author