I have tried to make a package of an open-source nodejs project using the following command.
npm pack
or
npm pack
After I got the tar file, I installed it by
npm install tar_file_path
After I used required api in another Nodejs project, it could not load or import properly. I am not able to launch or update the index.html file of the packaged folder.
Please guide me or help me fix this problem.
Thanks
Top comments (1)
I thought need to build it first with
npm run build
, maybe use npm workspaces (or yarn workspaces), to import files from another project, or some tool for monorepos, liketurbopack
. Not a pro in this either.I had a library code, and few examples that import it via npm workspaces. Basically different folders, evey one has it's own
package.json
, and workspaces defined in a mainpackages.json
github.com/asmyshlyaev177/state-in...
This way can see changes in real time if change library code.