0

I have workspace with several packages and plan to reference one to other.

+ root
|-+ packages
  |-+ openapi-jsdoc
  |-+ api-1
  |-+ api-2

My api-1 and api-2 would like to use openapi-jsdoc, which in my imagination is as easy as doing cd packages/api-1; npm install ../openapi-jsdoc. But it is not, and found weird errors.

$ npm install ../packages/openapi-jsdoc
npm ERR! Cannot set properties of null (setting 'dev')

$ npm install packages/openapi-jsdoc
npm ERR! code 128
npm ERR! An unknown git error occurred
npm ERR! command git --no-replace-objects ls-remote ssh://git@github.com/packages/openapi-jsdoc.git
npm ERR! ERROR: Repository not found.
npm ERR! fatal: Could not read from remote repository.

$ npm install git+file:packages/openapi-jsdoc/
npm ERR! code 128
npm ERR! An unknown git error occurred
npm ERR! command git --no-replace-objects ls-remote file://packages/openapi-jsdoc/

Is there any concept of workspace I'm missed out. Then, how to do this correctly?

Abdillah
  • 982
  • 11
  • 28
  • This seems related to https://stackoverflow.com/questions/70371574/npm-8-workspaces-install-one-package-as-the-dependency-for-another-package-in . Per the npm cli bug referenced in that SO, the bug was fixed in `npm@8.19.4` – David R. Jun 06 '23 at 16:56

0 Answers0