turborepo: bin of local package not resolving properly

/packages/next-typesafe-url/package.json
// ...
"bin": "./dist/cli.js",
"typings": "./dist/index.d.ts",
"exports": {
".": {
"require": "./dist/index.js",
"import": "./dist/index.mjs"
},
"./server": {
"require": "./dist/server.js",
"import": "./dist/server.mjs"
},
"./client": {
"require": "./dist/client.js",
"import": "./dist/client.mjs"
}
},
// ...
// ...
"bin": "./dist/cli.js",
"typings": "./dist/index.d.ts",
"exports": {
".": {
"require": "./dist/index.js",
"import": "./dist/index.mjs"
},
"./server": {
"require": "./dist/server.js",
"import": "./dist/server.mjs"
},
"./client": {
"require": "./dist/client.js",
"import": "./dist/client.mjs"
}
},
// ...
/turbo.json
{
"$schema": "https://turbo.build/schema.json",
"globalDependencies": ["**/.env.*local"],
"pipeline": {
"build": {
"dependsOn": ["^build"],
"outputs": ["dist/**", ".next/**", "!.next/cache/**"]
},
"lint": {
"outputs": []
},
"dev": {
"cache": false
}
}
}
{
"$schema": "https://turbo.build/schema.json",
"globalDependencies": ["**/.env.*local"],
"pipeline": {
"build": {
"dependsOn": ["^build"],
"outputs": ["dist/**", ".next/**", "!.next/cache/**"]
},
"lint": {
"outputs": []
},
"dev": {
"cache": false
}
}
}
Issue: in my example app, I import the package
"next-typesafe-url": "workspace:*",
"next-typesafe-url": "workspace:*",
the library code is imported and runs fine, except whenever I run npx next-typesafe-url to use my cli it doesnt go the the dist folder I have listed under bin in my package.json
PS C:\next-typesafe-url\examples\pagesdir> npx next-typesafe-url
node:internal/modules/cjs/loader:959
throw err;
^

Error: Cannot find module 'C:\next-typesafe-url\packages\next-typesafe-url\cli.ts'
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:956:15)
at Function.Module._load (node:internal/modules/cjs/loader:804:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
PS C:\next-typesafe-url\examples\pagesdir> npx next-typesafe-url
node:internal/modules/cjs/loader:959
throw err;
^

Error: Cannot find module 'C:\next-typesafe-url\packages\next-typesafe-url\cli.ts'
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:956:15)
at Function.Module._load (node:internal/modules/cjs/loader:804:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
any help is appreciated thanks
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server