-1

I am trying to build Atom from source in Linux Mint 17.3 and have almost finished the build process. I am following this tutorial: https://www.tecmint.com/atom-text-and-source-code-editor-for-linux/ along with other pages for help with errors.

I have just run this command: sudo script/build --create-debian-package --install. If I run the command without those two options, the build seems to work fine, then at the end of the output it suggests adding these two options to install the software. However, with these two options, I get the following error:

Installing modules ✗
> leveldown@4.0.1 install /home/akaash/Git/atom/node_modules/github/node_modules/leveldown
> prebuild-install || node-gyp rebuild


prebuild-install WARN install EACCES: permission denied, mkdir '/home/akaash/Git/atom/node_modules/github/node_modules/leveldown/build'
gyp info it worked if it ends with ok
gyp verb cli [ '/home/akaash/Git/atom/apm/node_modules/atom-package-manager/bin/node',
gyp verb cli   '/home/akaash/Git/atom/apm/node_modules/atom-package-manager/node_modules/.bin/node-gyp',
gyp verb cli   'rebuild' ]
gyp info using node-gyp@3.4.0
gyp info using node@8.9.3 | linux | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "/home/akaash/Git/atom/apm/node_modules/atom-package-manager/bin/python-interceptor.sh" in the PATH
gyp verb `which` succeeded /home/akaash/Git/atom/apm/node_modules/atom-package-manager/bin/python-interceptor.sh /home/akaash/Git/atom/apm/node_modules/atom-package-manager/bin/python-interceptor.sh
gyp verb check python version `/home/akaash/Git/atom/apm/node_modules/atom-package-manager/bin/python-interceptor.sh -c "import platform; print(platform.python_version());"` returned: "2.7.6\n"
gyp verb get node dir compiling against --target node version: 2.0.18
gyp verb command install [ '2.0.18' ]
gyp verb install input version string "2.0.18"
gyp verb install installing version: iojs-2.0.18
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version is already installed, need to check "installVersion"
gyp verb got "installVersion" 9
gyp verb needs "installVersion" 9
gyp verb install version is good
gyp verb get node dir target node version installed: iojs-2.0.18
gyp verb build dir attempting to create "build" dir: /home/akaash/Git/atom/node_modules/github/node_modules/leveldown/build
gyp ERR! configure error 
gyp ERR! stack Error: EACCES: permission denied, mkdir '/home/akaash/Git/atom/node_modules/github/node_modules/leveldown/build'
gyp ERR! System Linux 3.19.0-32-generic
gyp ERR! command "/home/akaash/Git/atom/apm/node_modules/atom-package-manager/bin/node" "/home/akaash/Git/atom/apm/node_modules/atom-package-manager/node_modules/.bin/node-gyp" "rebuild"
gyp ERR! cwd /home/akaash/Git/atom/node_modules/github/node_modules/leveldown
gyp ERR! node -v v8.9.3
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok 
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! leveldown@4.0.1 install: `prebuild-install || node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the leveldown@4.0.1 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/akaash/.atom/.apm/_logs/2019-03-29T10_14_30_223Z-debug.log
child_process.js:630
    throw err;
    ^

Error: Command failed: /home/akaash/Git/atom/apm/node_modules/atom-package-manager/bin/apm --loglevel=error install
  at checkExecSyncError (child_process.js:607:13)
  at Object.execFileSync (child_process.js:627:13)
  at module.exports (/home/akaash/Git/atom/script/lib/run-apm-install.js:14:16)
  at module.exports (/home/akaash/Git/atom/script/lib/transpile-packages-with-custom-transpiler-paths.js:30:7)
  at Object.<anonymous> (/home/akaash/Git/atom/script/build:68:3)
  at Module._compile (module.js:653:30)
  at Object.Module._extensions..js (module.js:664:10)
  at Module.load (module.js:566:32)
  at tryModuleLoad (module.js:506:12)
  at Function.Module._load (module.js:498:3)
  at Function.Module.runMain (module.js:694:10)
  at startup (bootstrap_node.js:204:16)
  at bootstrap_node.js:625:3

I have looked at the log and the end of that file is the same as the npm errors at the end of the above output. But I am not sure what most of it means.

How can I fix this and install Atom properly?

EDIT:

I understand there is a 'permission denied' error, but I would have thought that would be fixed by using sudo. But that's not the case, so I'm still stuck trying to figure this out.

  • 1
    Did you bother reading the error output from your commands? It tells you in the very first WARN and ERR statements that there is a 'permission denied' issue in the path. – 0xSheepdog Mar 29 at 14:44
  • 1
    I did read the output and there was a similar error the first time I ran the command, which was without sudo. So I thought running the command with sudo would fix it, but clearly not. That's why I'm asking for help, because I don't know where to go from there. But thanks for pointing that out anyway. – kashveyron Mar 29 at 15:50
0

I think I have found the solution to this issue. After trying many different fixes and none of them working, I ran sudo chown -R akaash:akaash ~/Git/atom then script/build --create-debian-package --compress-artifacts --install --unsafe-perm=true --allow-root --global leveldown.

I believe the chown command removed the need to use sudo.

Somewhere along the way I found this website:

https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally

which lead me to:

https://github.com/creationix/nvm

which explained how to update npm with a node version manager rather than a node installer.

This may or may not have helped, though I know it did update npm. But somehow a combination of everything I tried eventually got rid of the error.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.