infi-pc / locatorjs

https://www.locatorjs.com
1.31k stars 60 forks source link

bug: npm install does not work #119

Closed wootra closed 11 months ago

wootra commented 11 months ago

Where the bug happens

your browser

No response

Describe the bug

I'm trying to use locator.js. (2023/09/22) by running npm install -D @locator/babel-jsx following the instruction of https://www.locatorjs.com/install/react-data-id page. my node/npm version is "node": "16.20.2", "npm": "8.19.4"

tried multiple versions/option, but none of them works returning this error:

npm ERR! code EUNSUPPORTEDPROTOCOL
npm ERR! Unsupported URL Type "workspace:": workspace:^

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/sjun/.npm/_logs/2023-09-22T21_54_33_668Z-debug-0.log

I googled a little about this issue, found it this problem solves when I use yarn ( or pnpm ). using pnpm didn't have a luck, but for yarn, it actually asked me what workspace I will use, and when I choose it, it started working as expected.

But In my company, changing a package manager is not a easy decision. Is it really only one way that I can fix this problem?

wootra commented 11 months ago

BTW, this article is what I found from googling : https://stackoverflow.com/a/69489832

wootra commented 11 months ago

I found 0.3.1 version is working as expected. seems like this is a problem with 0.4.1 version.

wootra commented 11 months ago

looks like this project is using turborepo and should follow certain setup process to deploy individual package into npm. https://turbo.build/repo/docs/handbook/publishing-packages

image

https://turbo.build/repo/docs/handbook/publishing-packages/bundling https://turbo.build/repo/docs/handbook/publishing-packages/versioning-and-publishing

infi-pc commented 11 months ago

Thank you @wootra for checking this. You are completely right about the turborepo. I made a big mistake when releasing the last version. I normally use lerna publish for it, but this time I got a network error, so I published the packages manually one by one, but I didn't realize it wouldn't rewrite the workspace versions.

I have just released 0.4.2, it should work fine now.

wootra commented 11 months ago

this issue is fixed on 0.4.2, so I am closing it. thanks for the fast address!