Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

'node-gyp rebuild' fails when attempting to rebuild autocomplete-latex #84

Open
ExecutorElassus opened this issue Aug 2, 2018 · 4 comments

Comments

@ExecutorElassus
Copy link

autocomplete-latex 0.9.0 apparently contains native modules that were compiled for an earlier version of Atom than mine (1.29.0-beta2), but rebuild fails with the following (this is the partial log from atom's internal console output):

/usr/share/atom/resources/app/apm/node_modules/npm/bin/node-gyp-bin/node-gyp: line 5: /usr/share/atom/resources/app/apm/bin/../node_modules/.bin/node-gyp: Permission denied

npm ERR! Linux 4.17.11-gentoo
npm ERR! argv "/usr/share/atom/resources/app/apm/bin/node" "/usr/share/atom/resources/app/apm/node_modules/npm/bin/npm-cli.js" "--globalconfig" "/[$HOME]/.atom/.apm/.apmrc" "--userconfig" "/[$HOME]/.atom/.apmrc" "rebuild" "--runtime=electron" "--target=2.0.5" "--arch=x64"
npm ERR! node v6.9.5
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 126
npm ERR! 
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
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 oniguruma package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs oniguruma
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls oniguruma
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /[$HOME]/.atom/packages/autocomplete-latex/npm-debug.log

That first line suggests something's wrong with my permissions, but I'm not sure how to debug.

Thanks for the help.

@ExecutorElassus
Copy link
Author

Update: when I tried to install the autocomplete-latex package on atom as root, I got the following:


Installing “[email protected]” failed.Hide output…

> [email protected] install /tmp/apm-install-dir-11875-10899-1ke99en.hmnzpk3xr/node_modules/autocomplete-latex/node_modules/oniguruma
> node-gyp rebuild

/tmp/apm-install-dir-11875-10899-1ke99en.hmnzpk3xr
└── (empty)


npm WARN deprecated [email protected]: CoffeeScript on NPM has moved to "coffeescript" (no hyphen)
/usr/share/atom/resources/app/apm/node_modules/npm/bin/node-gyp-bin/node-gyp: line 5: /usr/share/atom/resources/app/apm/bin/../node_modules/.bin/node-gyp: Permission denied
npm WARN enoent ENOENT: no such file or directory, open '/tmp/apm-install-dir-11875-10899-1ke99en.hmnzpk3xr/package.json'
npm WARN apm-install-dir-11875-10899-1ke99en.hmnzpk3xr No description
npm WARN apm-install-dir-11875-10899-1ke99en.hmnzpk3xr No repository field.
npm WARN apm-install-dir-11875-10899-1ke99en.hmnzpk3xr No README data
npm WARN apm-install-dir-11875-10899-1ke99en.hmnzpk3xr No license field.
npm ERR! Linux 4.17.11-gentoo
npm ERR! argv "/usr/share/atom/resources/app/apm/bin/node" "/usr/share/atom/resources/app/apm/node_modules/npm/bin/npm-cli.js" "--globalconfig" "/root/.atom/.apm/.apmrc" "--userconfig" "/root/.atom/.apmrc" "install" "/tmp/d-11875-10899-1q7y3g6.r5x4njc3di/package.tgz" "--runtime=electron" "--target=2.0.5" "--arch=x64" "--global-style"
npm ERR! node v6.9.5
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 126
npm ERR! 
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
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 oniguruma package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs oniguruma
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls oniguruma
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /tmp/apm-install-dir-11875-10899-1ke99en.hmnzpk3xr/npm-debug.log
npm ERR! code 1

That might give you some more information on what's going wrong. The file npm-debug.log does not exist in that subdirectory, nor anywhere else I can find it.

Thanks again.

@Aerijo
Copy link

Aerijo commented Aug 10, 2018

@ExecutorElassus Sorry about that; I'll look into it.

@Aerijo
Copy link

Aerijo commented Aug 11, 2018

@ExecutorElassus I tried installing on an Ubuntu VM from scratch, and initially it failed completely. Turns out I needed to install build tools. When I did this, it managed to install fine. However, Atom-beta showed a deprecation-cop warning that prompted me to rebuild the package. This worked, and I could autocomplete.

I haven't worked out why it's not building the correct version yet; autocomplete-latex itself does not come with any compiled files, but it depends on first-mate which seems to open a whole can of worms.

Edit: It seems to work now if you have the build tools installed before hand. I'm not sure if it's something I did, but let me know if the above doesn't help with the issue. I'll need to update the repo to explain the dependencies.

@ExecutorElassus
Copy link
Author

Hi @Aerijo,

I've run into this problem again, now with atom-1.32.0_beta3. Same initial error, same failure when attempting to rebuild the package.

I did a bit of digging on node-gyp, however, and found this:


/usr/share/atom/resources/app/apm/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin # ls
node-gyp  node-gyp.cmd
domo-kun /usr/share/atom/resources/app/apm/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin # ./node-gyp rebuild
bash: ./node-gyp: Permission denied
domo-kun /usr/share/atom/resources/app/apm/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin # ls -l *
-rw-r--r-- 1 root root 172 12. Okt 15:17 node-gyp
-rw-r--r-- 1 root root 148 12. Okt 15:17 node-gyp.cmd


Which strongly implies that node-gyp needs to be set executable, and that maybe this is the problem?

Am I reading this right?

Cheers,

EE

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants