haloapi.js icon indicating copy to clipboard operation
haloapi.js copied to clipboard

TypeError: exists is not a function

Open gebrial opened this issue 8 years ago • 4 comments

When I try to load this package in my ember application I get an error, "TypeError: exists is not a function". I've tracked it down to a file in the index.js file in the codependency package in the exports.findPackage function. Not sure where to go from here.

gebrial avatar Oct 02 '16 17:10 gebrial

I suspect you have a package installed that is clobbering require('fs') within codependency.

  1. Which version of Node and npm are you using?
  2. Open a node console in your project root and type require.resolve('fs'). What does it give you?
  3. Is there an fs directory in node_modules? If so, delete it.
  4. Is fs in your package.json? If so, remove it (fs is in node core).

azz avatar Oct 03 '16 08:10 azz

I did both 3 and 4 but it still isn't working.

I'm running node version 6.6.0 and npm version 3.10.3. require.resolve('fs'); returns 'fs'

gebrial avatar Oct 05 '16 05:10 gebrial

You seen be be resolving the correct fs module. Does require('fs').existsSync give you a function or undefined?

azz avatar Oct 05 '16 12:10 azz

it returns [Function]

gebrial avatar Oct 06 '16 04:10 gebrial