atom / fuzzaldrin

Fuzzy filtering and string scoring
MIT License
319 stars 28 forks source link

Cannot find module 'fuzzaldrin' #28

Closed rm-code closed 8 years ago

rm-code commented 8 years ago

Hi,

I'm trying to write a custom provider to use with autocomplete+ and I'm having problems with the fuzzaldrin module. I'm requiring it in my provider.coffee like this:

fs = require 'fs'
path = require 'path'
fuzzaldrin = require 'fuzzaldrin'

module.exports =
    selector: '.source.lua'
    disableForSelector: '.source.lua .comment, .source.lua .string'
...

And in my package.json I have this:

  "dependencies": {
    "fuzzaldrin": "^2.1.0"
  }

But still I get this when I load with the package:

At Cannot find module 'fuzzaldrin'

Error: Cannot find module 'fuzzaldrin'
    at Module._resolveFilename (module.js:336:15)
    at Function.exports.register.Module._resolveFilename (/Applications/Atom.app/Contents/Resources/app.asar/src/module-cache.js:383:52)
    at Function.Module._load (module.js:286:25)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (/Users/Robert/Coding/Atom/love-atom/lib/love-provider.coffee:3:14)
    at Object.<anonymous> (/Users/Robert/Coding/Atom/love-atom/lib/love-provider.coffee:1:1)
    at Module._compile (module.js:434:26)
    at Object.keys.forEach.Object.defineProperty.value [as .coffee] (/Applications/Atom.app/Contents/Resources/app.asar/src/compile-cache.js:190:21)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (/Users/Robert/Coding/Atom/love-atom/lib/love-atom.coffee:2:16)
    at Object.<anonymous> (/Users/Robert/Coding/Atom/love-atom/lib/love-atom.coffee:2:1)
    at Module._compile (module.js:434:26)
    at Object.keys.forEach.Object.defineProperty.value [as .coffee] (/Applications/Atom.app/Contents/Resources/app.asar/src/compile-cache.js:190:21)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Package.module.exports.Package.requireMainModule (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:661:34)
    at /Applications/Atom.app/Contents/Resources/app.asar/src/package.js:115:28
    at Package.module.exports.Package.measure (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:92:15)
    at Package.module.exports.Package.load (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:106:12)
    at PackageManager.module.exports.PackageManager.loadPackage (/Applications/Atom.app/Contents/Resources/app.asar/src/package-manager.js:434:14)
    at PackageManager.module.exports.PackageManager.loadPackages (/Applications/Atom.app/Contents/Resources/app.asar/src/package-manager.js:386:14)
    at AtomEnvironment.module.exports.AtomEnvironment.startEditorWindow (/Applications/Atom.app/Contents/Resources/app.asar/src/atom-environment.js:667:21)
    at Object.<anonymous> (/Applications/Atom.app/Contents/Resources/app.asar/src/initialize-application-window.js:38:8)
    at Object.<anonymous> (/Applications/Atom.app/Contents/Resources/app.asar/src/initialize-application-window.js:49:4)
    at Module._compile (module.js:434:26)
    at Object.keys.forEach.Object.defineProperty.value [as .js] (/Applications/Atom.app/Contents/Resources/app.asar/src/compile-cache.js:190:21)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at setupWindow (file:///Applications/Atom.app/Contents/Resources/app.asar/static/index.js:79:5)
    at window.onload (file:///Applications/Atom.app/Contents/Resources/app.asar/static/index.js:35:9)

The strange thing is that I have looked at some downloaded packages which are using fuzzaldrin and I can't see anything they are doing differently. Any hints would be much appreciated :+1:

jeancroy commented 8 years ago

have you tried to do npm install (or apm install) in that directory?

On Sat, Dec 5, 2015, 19:29 rm-code notifications@github.com wrote:

Hi,

I'm trying to write a custom provider to use with autocomplete+ and I'm having problems with the fuzzaldrin module. I'm requiring it in my provider.coffee like this:

fs = require 'fs'path = require 'path'fuzzaldrin = require 'fuzzaldrin' module.exports = selector: '.source.lua' disableForSelector: '.source.lua .comment, .source.lua .string'...

And in my package.json I have this:

"dependencies": { "fuzzaldrin": "^2.1.0" }

But still I get this when I load with the package:

At Cannot find module 'fuzzaldrin'

Error: Cannot find module 'fuzzaldrin' at Module._resolveFilename (module.js:336:15) at Function.exports.register.Module._resolveFilename (/Applications/Atom.app/Contents/Resources/app.asar/src/module-cache.js:383:52) at Function.Module._load (module.js:286:25) at Module.require (module.js:365:17) at require (module.js:384:17) at Object. (/Users/Robert/Coding/Atom/love-atom/lib/love-provider.coffee:3:14) at Object. (/Users/Robert/Coding/Atom/love-atom/lib/love-provider.coffee:1:1) at Module._compile (module.js:434:26) at Object.keys.forEach.Object.defineProperty.value as .coffee at Module.load (module.js:355:32) at Function.Module._load (module.js:310:12) at Module.require (module.js:365:17) at require (module.js:384:17) at Object. (/Users/Robert/Coding/Atom/love-atom/lib/love-atom.coffee:2:16) at Object. (/Users/Robert/Coding/Atom/love-atom/lib/love-atom.coffee:2:1) at Module._compile (module.js:434:26) at Object.keys.forEach.Object.defineProperty.value as .coffee at Module.load (module.js:355:32) at Function.Module._load (module.js:310:12) at Module.require (module.js:365:17) at require (module.js:384:17) at Package.module.exports.Package.requireMainModule (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:661:34) at /Applications/Atom.app/Contents/Resources/app.asar/src/package.js:115:28 at Package.module.exports.Package.measure (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:92:15) at Package.module.exports.Package.load (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:106:12) at PackageManager.module.exports.PackageManager.loadPackage (/Applications/Atom.app/Contents/Resources/app.asar/src/package-manager.js:434:14) at PackageManager.module.exports.PackageManager.loadPackages (/Applications/Atom.app/Contents/Resources/app.asar/src/package-manager.js:386:14) at AtomEnvironment.module.exports.AtomEnvironment.startEditorWindow (/Applications/Atom.app/Contents/Resources/app.asar/src/atom-environment.js:667:21) at Object. (/Applications/Atom.app/Contents/Resources/app.asar/src/initialize-application-window.js:38:8) at Object. (/Applications/Atom.app/Contents/Resources/app.asar/src/initialize-application-window.js:49:4) at Module._compile (module.js:434:26) at Object.keys.forEach.Object.defineProperty.value as .js at Module.load (module.js:355:32) at Function.Module._load (module.js:310:12) at Module.require (module.js:365:17) at require (module.js:384:17) at setupWindow (file:///Applications/Atom.app/Contents/Resources/app.asar/static/index.js:79:5) at window.onload (file:///Applications/Atom.app/Contents/Resources/app.asar/static/index.js:35:9)

The strange thing is that I have looked at some downloaded packages which are using fuzzaldrin and I can't see anything they are doing differently. Any hints would be much appreciated [image: :+1:]

— Reply to this email directly or view it on GitHub https://github.com/atom/fuzzaldrin/issues/28.

50Wliu commented 8 years ago

Use apm install, not npm install.

rm-code commented 8 years ago

Opened a ticket in the autocomplete-plus repository since (as far as I can tell) fuzzaldrin isn't needed for a provider. Sorry for the noise!

jeancroy commented 8 years ago

But proposed solution don't work? To require it has to be in package.json AND you need to run packaging tool to download compile and what not

On Tue, Dec 8, 2015, 17:36 rm-code notifications@github.com wrote:

Opened a ticket in the autocomplete-plus repository since (as far as I can tell) fuzzaldrin isn't needed for a provider. Sorry for the noise!

— Reply to this email directly or view it on GitHub https://github.com/atom/fuzzaldrin/issues/28#issuecomment-163041799.

rm-code commented 8 years ago

But proposed solution don't work?

Not as far as I can tell. I have "fuzzaldrin": "^2.1.0" listed in package.json. I cloned this repo, and then ran apm install on it as @50Wliu suggested. The installation finished fine, but it still gives me the error about not finding the package when I reload the editor.

If you have further instructions I'll gladly try them out :+1: But as I said it is no longer needed for my project.