code-complexity icon indicating copy to clipboard operation
code-complexity copied to clipboard

esprima is not automatically installed

Open berkes opened this issue 2 years ago • 4 comments

When I run 4.0.0 using the example from the readme, npx then it fails with

Error: Cannot find module 'esprima'

Installing with npm install code-complexity also does not pull it in. Explicitly installing with npm install esprima solves the issue.

I'm no nodejs expert, so I don't know how to present a fix for this -I'm not familiar with bundleDependencies- but I suspect something in the package.json is off, or some vendored package should be included.

berkes avatar Dec 02 '22 10:12 berkes

Probably did not execute npm pack before publishing?

See bundleDependencies.

cope avatar Jan 15 '23 09:01 cope

@simonrenoult could you please republish with esprima?

rluvaton avatar Mar 01 '23 22:03 rluvaton

Apparently, this problem appeared in v4.3.0, because v4.2.2 is still working on my end.

adrienjoly avatar Jul 18 '23 12:07 adrienjoly

The root of this problem stems from escomplex. https://github.com/escomplex/escomplex/issues/206

escomplexV2.0.0-alpha (commit) is the version referenced here and on npm. That versions package.json has esprima as a devDependency rather than a dependency.

image

RonaldZielaznicki avatar Oct 25 '23 19:10 RonaldZielaznicki