yongkangchen / atom-ctags

better autocomplete for atom, using ctags
https://atom.io/packages/atom-ctags
MIT License
87 stars 35 forks source link

Failed to activate the atom-ctags package #200

Open michaelczhou opened 6 years ago

michaelczhou commented 6 years ago

Cannot find module '/opt/atom/resources/app.asar.unpacked/node_modules/ctags/build/Release/ctags.node' Error: Cannot find module '/opt/atom/resources/app.asar.unpacked/node_modules/ctags/build/Release/ctags.node' at Module._resolveFilename (module.js:470:15) at Module._resolveFilename (/opt/atom/resources/electron.asar/common/reset-search-paths.js:35:12) at Function.get_Module._resolveFilename (/opt/atom/resources/app/src/module-cache.js:354:58) at Module.require (file:///opt/atom/resources/app/static/index.js:40:43) at require (/opt/atom/resources/app/src/native-compile-cache.js:66:33) at Object.<anonymous> (/home/zc/.atom/packages/atom-ctags/node_modules/ctags/src/ctags.coffee:1:10) at Object.<anonymous> (/home/zc/.atom/packages/atom-ctags/node_modules/ctags/src/ctags.coffee:1:1) at Object.<anonymous> (/home/zc/.atom/packages/atom-ctags/node_modules/ctags/src/ctags.coffee:1:1) at Module.get_Module._compile (/opt/atom/resources/app/src/native-compile-cache.js:106:36) at Object.value [as .coffee] (/opt/atom/resources/app/src/compile-cache.js:239:29) at Module.load (module.js:488:32) at tryModuleLoad (module.js:447:12) at Function.Module._load (module.js:439:3) at Module.require (file:///opt/atom/resources/app/static/index.js:47:45) at require (/opt/atom/resources/app/src/native-compile-cache.js:66:33) at Object.<anonymous> (/home/zc/.atom/packages/atom-ctags/lib/ctags-cache.coffee:3:9) at Object.<anonymous> (/home/zc/.atom/packages/atom-ctags/lib/ctags-cache.coffee:2:1) at Object.<anonymous> (/home/zc/.atom/packages/atom-ctags/lib/ctags-cache.coffee:2:1) at Module.get_Module._compile (/opt/atom/resources/app/src/native-compile-cache.js:106:36) at Object.value [as .coffee] (/opt/atom/resources/app/src/compile-cache.js:239:29) at Module.load (module.js:488:32) at tryModuleLoad (module.js:447:12) at Function.Module._load (module.js:439:3) at Module.require (file:///opt/atom/resources/app/static/index.js:47:45) at require (/opt/atom/resources/app/src/native-compile-cache.js:66:33) at Object.activate (/home/zc/.atom/packages/atom-ctags/lib/main.coffee:48:19) at Package.module.exports.Package.activateNow (/opt/atom/resources/app/src/package.js:253:25) at /opt/atom/resources/app/src/package.js:225:38 at Package.module.exports.Package.measure (/opt/atom/resources/app/src/package.js:99:21) at /opt/atom/resources/app/src/package.js:218:32

kkraju4u commented 6 years ago

Temporary fix.

edit ~/.atom/packages/atom-ctags/node_modules/ctags/src/ctags.coffee and in the first line {Tags} = require(process.resourcesPath + '/app/node_modules/ctags/build/Release/ctags.node') change app toapp.asar.unpacked, which becomes {Tags} = require(process.resourcesPath + '/app.asar.unpacked/node_modules/ctags/build/Release/ctags.node')

michaelczhou commented 6 years ago

@kkraju4u my file already became as

{Tags} = require(process.resourcesPath + '/app.asar.unpacked/node_modules/ctags/build/Release/ctags.node')

but it's not working

kkraju4u commented 6 years ago

@michaelczhou If you are using linux, try locate ctags.node in terminal to find the location of the node package. use that location in the coffee file.

michaelczhou commented 6 years ago

@kkraju4u Thx!

sergeialimov commented 6 years ago

Hi, is there any solution for mac? My first line in ctag.coffee is {Tags} = require(process.resourcesPath + '/app.asar.unpacked/node_modules/ctags/build/Release/ctags.node') by default

wuyukai879293 commented 6 years ago

@sergeialimov for Mac,actually you could find the ctags.node in app directory,/Applications/Atom.app/Contents/Resources/app/node_modules/ctags/build/Release/ctags.node,not in the app.asar.unpacked directory,so you should change the first line of your ctag.coffee file to {Tags} = require(process.resourcesPath + '/app/node_modules/ctags/build/Release/ctags.node'),which just replace the app.asar.unpacked to app,it works for me,wish it would work for you.