If you're hitting a bug in Atom or just want to experiment with adding a feature to the core of the system, you'll want to run Atom in Dev Mode with access to a local copy of the Atom source.
Follow the GitHub Help instructions on how to fork a repo.
Once you've set up your fork of the atom/atom repository, you can clone it to your local machine:
git clone git@github.com:your-username/atom.git
From there, you can navigate into the directory where you've cloned the Atom source code and run the bootstrap script to install all the required dependencies:
cd where-you-cloned-atom script/bootstrap
cd where-you-cloned-atom script/bootstrap
cd where-you-cloned-atom script\bootstrap
Once you have a local copy of Atom cloned and bootstrapped, you can then run Atom in Development Mode. But first, if you cloned Atom to somewhere other than ~/github/atom%USERPROFILE%\github\atom you will need to set the ATOM_DEV_RESOURCE_PATH environment variable to point to the folder in which you cloned Atom. To run Atom in Dev Mode, use the --dev parameter from the terminal:
atom --dev path-to-open
Note: If the atom command does not respond in the terminal, then try atom-dev or atom-beta. The suffix depends upon the particular source code that was cloned.
There are a couple benefits of running Atom in Dev Mode:
ATOM_DEV_RESOURCE_PATH environment variable is set correctly, Atom is run using the source code from your local atom/atom repository. This means that you don't have to run script/buildscript\build every time you change code. Just restart Atom 👍~/.atom/dev/packages%USERPROFILE%\.atom\dev\packages are loaded instead of packages of the same name normally loaded from other locations. This means that you can have development versions of packages you use loaded but easily go back to the stable versions by launching without Dev Mode.window:reload) to see changes to those.In order to run Atom Core tests from the terminal, first be certain to set the ATOM_DEV_RESOURCE_PATH environment variable as mentioned above and then:
cd path-to-your-local-atom-repo atom --test spec
In order to build Atom from source, you need to have a number of other requirements and take additional steps.
npm install -g npm)[Your_Drive_Letter]:\Python37 e.g. C:\Python37, (even if your version of Python 3 isn't 3.7, that's one place where the scripts will look.) python.exe using e.g.: mklink /d %SystemDrive%\Python27 D:\elsewhere\Python27(Links should be set at either %SystemDrive%\Python27 or %SystemDrive%\Python37, regardless of what version of Python you actually have.)C++ build tools:
npm install --global windows-build-tools@4 to installAlso ensure that:
git command is in your pathGYP_MSVS_VERSION environment variable to the Visual Studio/Build Tools version (2015 or 2017.) e.g. [Environment]::SetEnvironmentVariable("GYP_MSVS_VERSION", "2015", "User") in PowerShell (or set it in Windows advanced system settings).Ubuntu LTS 16.04 64-bit is the recommended platform.
npm install -g npm)For more details, scroll down to find how to setup a specific Linux distro.
Install GNOME headers and other basic prerequisites:
sudo apt-get install build-essential git libsecret-1-dev fakeroot rpm libx11-dev libxkbfile-dev
If script/build exits with an error, you may need to install a newer C++ compiler with C++11:
sudo add-apt-repository ppa:ubuntu-toolchain-r/test sudo apt-get update sudo apt-get install gcc-5 g++-5 sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 80 --slave /usr/bin/g++ g++ /usr/bin/g++-5 sudo update-alternatives --config gcc # choose gcc-5 from the list
sudo dnf --assumeyes install make gcc gcc-c++ glibc-devel git-core libsecret-devel rpmdevtools libX11-devel libxkbfile-devel
sudo yum install -y make gcc gcc-c++ glibc-devel git-core libsecret-devel rpmdevtools
sudo pacman -S --needed gconf base-devel git nodejs npm libsecret python libx11 libxkbfile
sbopkg -k -i node -i atom
sudo zypper install nodejs nodejs-devel make gcc gcc-c++ glibc-devel git-core libsecret-devel rpmdevtools libX11-devel libxkbfile-devel
script/build
To also install the newly built application, use script/build --install.
script\build
To also install the newly built application, use script\build --create-windows-installer and launch one of the generated installers.
script/build
To also install the newly built application, use the --create-debian-package or --create-rpm-package option and then install the generated package via the system package manager.
script/build Options--code-sign: signs the application with the GitHub certificate specified in $ATOM_MAC_CODE_SIGNING_CERT_DOWNLOAD_URL.--compress-artifacts: zips the generated application as out/atom-mac.zip.--install[=dir]: installs the application at ${dir}/Atom.app for dev and stable versions or at ${dir}/Atom-Beta.app for beta versions; ${dir} defaults to /Applications.script\build Options--code-sign: signs the application with the GitHub certificate specified in $WIN_P12KEY_URL.--compress-artifacts: zips the generated application as out\atom-windows.zip.--create-windows-installer: creates an .exe and two .nupkg packages in the out directory.--install[=dir]: installs the application in ${dir}\Atom\app-dev; ${dir} defaults to %LOCALAPPDATA%.script/build Options--compress-artifacts: zips the generated application as out/atom-{arch}.tar.gz.--create-debian-package: creates a .deb package as out/atom-{arch}.deb
--create-rpm-package: creates a .rpm package as out/atom-{arch}.rpm
--install[=dir]: installs the application in ${dir}; ${dir} defaults to /usr/local.Use this search to get a list of reports about build errors on macOS.
node is not recognized
node command is available on your path.msbuild.exe failed with exit code: 1
script\build stops with no error or warning shortly after displaying the versions of node, npm and Python
C:\atom instead of C:\my stuff\atom.C:\atom. Most likely, the path is too long. See issue #2200.error MSB4025: The project file could not be loaded. Invalid character in the given encoding.
%USERPROFILE%) has non-ASCII characters in it. This is a bug in gyp
which is used to build native Node.js modules and there is no known workaround.
'node_modules\.bin\npm' is not recognized as an internal or external command, operable program or batch file.
script\clean and then script\build again.script\build stops at installing runas with Failed at the runas@x.y.z install script.
error MSB8020: The build tools for Visual Studio 201? (Platform Toolset = 'v1?0') cannot be found.
GYP_MSVS_VERSION environment variable to 2015 or 2017 depending on what version of Visual Studio/Build Tools is installed and then script\clean followed by script\build (re-open the Command Prompt if you set the variable using the GUI).'node-gyp' is not recognized as an internal or external command, operable program or batch file.
npm install -g node-gyp, and run script\build again.Other node-gyp errors on first build attempt, even though the right Node.js and Python versions are installed.
If you get following error with a big traceback right after Atom starts:
TypeError: Unable to watch path
you have to increase number of watched files by inotify. For testing if this is the reason for this error you can execute:
sudo sysctl fs.inotify.max_user_watches=32768
then restart Atom. If Atom now works fine, you can make this setting permanent:
echo 32768 | sudo tee -a /proc/sys/fs/inotify/max_user_watches
See also #2082.
If you get this notice when attempting to run any script, you either do not have
Node.js installed, or node isn't identified as Node.js on your machine. If it's
the latter, this might be caused by installing Node.js via the distro package
manager and not nvm, so entering sudo ln -s /usr/bin/nodejs /usr/bin/node into
your terminal may fix the issue. On some variants (mostly Debian based distros)
you can use update-alternatives too:
sudo update-alternatives --install /usr/bin/node node /usr/bin/nodejs 1 --slave /usr/bin/js js /usr/bin/nodejs
If you get following error with a big traceback while building Atom:
sys.exit(gyp.script_main()) AttributeError: 'module' object has no attribute 'script_main' gyp ERR!
you need to uninstall the system version of gyp.
On Fedora you would do the following:
sudo yum remove gyp
Use this search
to get a list of reports about build errors on Linux.