konvajs / konva

Konva.js is an HTML5 Canvas JavaScript framework that extends the 2d context by enabling canvas interactivity for desktop and mobile applications.
http://konvajs.org/
Other
11.43k stars 918 forks source link

Request: add package-lock.json file (`npm run build` broken) #1757

Closed Balearica closed 4 months ago

Balearica commented 4 months ago

At present, cloning this repo, running npm install, and then npm run build produces the following error.

node_modules/@types/markdown-it/lib/index.d.ts:151:33 - error TS2694: Namespace 'LinkifyIt' has no exported member 'LinkifyIt'.

151     readonly linkify: LinkifyIt.LinkifyIt;
                                    ~~~~~~~~~

This appears to be caused by a recent change to a dependency of a dependency, so is not the fault of this package. However, this requires troubleshooting by users because this repo lacks a package-lock.json file. It looks like package-lock.json is explicitly excluded in the .gitignore file.

https://github.com/konvajs/konva/blob/master/.gitignore#L14

The package-lock.json file is intended to avoid exactly this sort of situation, and allow users to replicate a working environment with minimal effort, regardless of dependency updates. Therefore, I think the maintainers should consider removing this line from the .gitignore file and adding this file to make installation easier going forward.

Balearica commented 4 months ago

For other users experiencing this, adding the dependency @types/markdown-it@13.0.8 to package.json appears to resolve. This root cause of this issue is discussed here.

https://github.com/DefinitelyTyped/DefinitelyTyped/pull/69355

lavrton commented 4 months ago

I am not really sure if it is very useful for the repo. But the issue highlighted another issue, that typescript shouldn't check node_modules at all. Just added that skip.