atom-ctags icon indicating copy to clipboard operation
atom-ctags copied to clipboard

Failed to activate the atom-ctags package

Open michaelczhou opened this issue 7 years ago • 6 comments

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

michaelczhou avatar Dec 16 '17 03:12 michaelczhou

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')

kkraju4u avatar Dec 19 '17 06:12 kkraju4u

@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

michaelczhou avatar Dec 30 '17 12:12 michaelczhou

@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.

kkraju4u avatar Dec 30 '17 13:12 kkraju4u

@kkraju4u Thx!

michaelczhou avatar Jan 02 '18 06:01 michaelczhou

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

sergeialimov avatar Feb 18 '18 06:02 sergeialimov

@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.

wuyukai879293 avatar Mar 12 '18 08:03 wuyukai879293