Install Atom from Command Line/Terminal?


#1

I apologize if this has been asked (I wasn’t able to search for it), but is it possible to do what the topic title states?

Edit: I use BSD, but perhaps, this will help! http://stackoverflow.com/questions/24741996/how-to-upgrade-atom-editor-on-linux


#2

Do these instructions help?


#3

Reading the more recent version of freebsd.md

From https://gitter.im/trueos/Random?at=587d39d396a565f844091fa8:

Error: Atom does not build properly on node v7+. node v7.4.0 is installed.

I used nvm to prefer use node v6.9.4 (npm v3.10.10).

script/build does not have the desired effect. A transcript:

$ nvm use v6.9.4
nvm is not compatible with the npm config "prefix" option: currently set to "/usr/home/grahamperrin/.nvm/versions/node/v6.9.4"
Run `npm config delete prefix` or `nvm use --delete-prefix v6.9.4` to unset it.
$ nvm use --delete-prefix v6.9.4
Now using node v6.9.4 (npm v3.10.10)
$ pwd
/opt/atom
$ sudo script/build
Node:   v6.9.4
Npm:    v3.10.5
Installing script dependencies
Downloading https://github.com/electron/electron/releases/download/v1.3.0/chromedriver-v2.21-freebsd-x64.zip failed: Non-200 response (404)
npm ERR! FreeBSD 12.0-CURRENT
npm ERR! argv "/usr/home/grahamperrin/.nvm/versions/node/v6.9.4/bin/node" "/opt/atom/script/node_modules/.bin/npm" "--loglevel=error" "install"
npm ERR! node v6.9.4
npm ERR! npm  v3.10.5
npm ERR! code ELIFECYCLE

npm ERR! electron-chromedriver@1.3.2 install: `node ./download-chromedriver.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the electron-chromedriver@1.3.2 install script 'node ./download-chromedriver.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the electron-chromedriver package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node ./download-chromedriver.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs electron-chromedriver
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls electron-chromedriver
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /opt/atom/script/npm-debug.log
child_process.js:506
    throw err;
    ^

Error: Command failed: /opt/atom/script/node_modules/.bin/npm --loglevel=error install
Downloading https://github.com/electron/electron/releases/download/v1.3.0/chromedriver-v2.21-freebsd-x64.zip failed: Non-200 response (404)
npm ERR! FreeBSD 12.0-CURRENT
npm ERR! argv "/usr/home/grahamperrin/.nvm/versions/node/v6.9.4/bin/node" "/opt/atom/script/node_modules/.bin/npm" "--loglevel=error" "install"
npm ERR! node v6.9.4
npm ERR! npm  v3.10.5
npm ERR! code ELIFECYCLE

npm ERR! electron-chromedriver@1.3.2 install: `node ./download-chromedriver.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the electron-chromedriver@1.3.2 install script 'node ./download-chromedriver.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the electron-chromedriver package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node ./download-chromedriver.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs electron-chromedriver
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls electron-chromedriver
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /opt/atom/script/npm-debug.log

    at checkExecSyncError (child_process.js:483:13)
    at Object.execFileSync (child_process.js:503:13)
    at module.exports (/opt/atom/script/lib/install-script-dependencies.js:10:16)
    at Object.<anonymous> (/opt/atom/script/bootstrap:26:1)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
$ 

Suggestions?

TIA


creationix/nvm: Node Version Manager - Simple bash script to manage multiple active node.js versions


#4

It looks like it’s trying to download a freebsd version of Chromedriver when none exists. You’ll have to find out where the download-chromedriver.js script is and see if hardcoding the OS to linux helps.


#5

chromedriver

Gained by configuring the port of Chromium to install chromedriver:

 β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ chromium-55.0.2883.87 ─────────────────────────────┐
 β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚  
 β”‚ β”‚+[x] CODECS      Compile and enable patented codecs like H.264            β”‚ β”‚  
 β”‚ β”‚+[x] DRIVER      Install chromedriver                                     β”‚ β”‚  
 β”‚ β”‚+[x] GCONF       GConf configuration backend support                      β”‚ β”‚  
 β”‚ β”‚+[x] KERBEROS    Kerberos support                                         β”‚ β”‚  
 β”‚ │────────────────────────────────── AUDIO ─────────────────────────────────│ β”‚  
 β”‚ β”‚+[x] ALSA        ALSA audio architecture support                          β”‚ β”‚  
 β”‚ β”‚+[x] PULSEAUDIO  PulseAudio sound server support                          β”‚ β”‚  
 β”‚ │────────────────────────────────── TESTS ─────────────────────────────────│ β”‚  
 β”‚ β”‚+[ ] DEBUG       Build with debugging support                             β”‚ β”‚  
 β”‚ β”‚+[ ] TEST        Build and/or run tests                                   β”‚ β”‚  
 β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚  
 β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€  
 β”‚                       <  OK  >            <Cancel>                           β”‚  
 β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  

Then, today:

$ pwd
/usr/ports/www/chromium
$ date ; uname -v
Fri 27 Jan 2017 14:18:30 GMT
FreeBSD 12.0-CURRENT #14 f92c24b(drm-next-4.7): Fri Jan  6 19:28:21 UTC 2017     root@gauntlet:/usr/obj/usr/src/sys/GENERIC 
$ sudo git pull
Password:
Already up-to-date.
$ cd ../..
$ pwd
/usr/ports
$ sudo git pull
Already up-to-date.
$ cd www/chromium
$ time sudo make install
===>  Building for chromium-55.0.2883.87
…

– and from the tail of that session:

…
===>  Installing for chromium-55.0.2883.87
===>  Checking if chromium already installed
===>   Registering installation for chromium-55.0.2883.87
pkg-static: duplicate file listing: /usr/local/bin/chromedriver, ignoring
Installing chromium-55.0.2883.87...
For correct operation, shared memory support has to be enabled
in Chromium by performing the following command as root :

sysctl kern.ipc.shm_allow_removed=1

To preserve this setting across reboots, append the following
to /etc/sysctl.conf :

kern.ipc.shm_allow_removed=1

===> SECURITY REPORT: 
      This port has installed the following files which may act as network
      servers and may therefore pose a remote security risk to the system.
/usr/local/share/chromium/chrome
/usr/local/bin/chromedriver

      If there are vulnerabilities in these programs there may be a security
      risk to the system. FreeBSD makes no guarantee about the security of
      ports included in the Ports Collection. Please type 'make deinstall'
      to deinstall the port if this is a concern.

      For more information, and contact details about the security
      status of this software, see the following webpage: 
http://www.chromium.org/Home
    17082.82 real     56877.31 user      1728.96 sys
$ ls -dhl /usr/local/bin/chromedriver
-r-xr-xr-x  1 root  wheel   6.5M 27 Jan 19:03 /usr/local/bin/chromedriver
$ 

Now:

$ /usr/local/bin/chromedriver
Starting ChromeDriver 2.24 (58530c9139c7c75c29272b028b9a47de76be7f4d) on port 9515
Only local connections are allowed.
^C
$ 

script/build

Again,

…
Error: Command failed: /opt/atom/script/node_modules/.bin/npm --loglevel=error install
Downloading https://github.com/electron/electron/releases/download/v1.3.0/chromedriver-v2.21-freebsd-x64.zip failed: Non-200 response (404)
…

– that’s 2.21, inferior to the installed version 2.24.


$ pwd
/opt/atom
$ find . -name "download-chromedriver.js" -print
$ pwd
/opt/atom
$ grep -R download-chromedriver.js .
./script/npm-debug.log:6594 silly gunzTarPerm extractEntry download-chromedriver.js
./script/npm-debug.log:8246 silly lifecycle electron-chromedriver@1.3.2~install: Args: [ '-c', 'node ./download-chromedriver.js' ]
./script/npm-debug.log:8257 verbose stack Error: electron-chromedriver@1.3.2 install: `node ./download-chromedriver.js`
./script/npm-debug.log:8265 error electron-chromedriver@1.3.2 install: `node ./download-chromedriver.js`
./script/npm-debug.log:8266 error Failed at the electron-chromedriver@1.3.2 install script 'node ./download-chromedriver.js'.
./script/npm-debug.log:8266 error     node ./download-chromedriver.js
grep: ./script/node_modules/.bin/chromedriver: No such file or directory
grep: ./script/node_modules/.bin/strip-dirs: No such file or directory
grep: ./script/node_modules/.bin/seek-bunzip: No such file or directory
grep: ./script/node_modules/.bin/seek-table: No such file or directory
$ cd ./script/node_modules/.bin
/opt/atom/script/node_modules/.bin
$ 

An experimental replacement of a symlink named chromedriver:

$ ls -dhl chromedriver 
lrwxr-xr-x  1 root  wheel    40B 25 Jan 20:26 chromedriver -> ../electron-chromedriver/chromedriver.js
$ sudo rm chromedriver 
$ sudo ln -s /usr/local/bin/chromedriver ./chromedriver
$ 

That did not have the desired effect. Still, script/build fails around the chromedriver stuff and the change that I made to the symlink is reverted:

lrwxr-xr-x  1 root  wheel    40B 27 Jan 19:41 chromedriver -> ../electron-chromedriver/chromedriver.js

As you can probably tell, I’m stumbling around here with (sorry) no prior experience of things such as node …!