dsherret / ts-nameof

nameof in TypeScript
MIT License
492 stars 23 forks source link

Incompatible with Yarn 2 #55

Closed bradleyayers closed 5 years ago

bradleyayers commented 5 years ago

There needs to be an explicit dependency on typescript (either dependencies or peerDependencies). At the moment I get the following error:

$ yarn workspaces/array lint
/Users/brad/project/.pnp.js:104984
        throw firstError;
        ^

Error: A package is trying to access another package without the second one being listed as a dependency of the first one

Required package: typescript (via "typescript")
Required by: ts-nameof@npm:3.0.3 (via /Users/brad/project/.yarn/cache/ts-nameof-npm-3.0.3-03b02cefb2c54377072f56fa0ccfe1c1d51b5a758471784afb4d9cc5ffe4ddd6.zip/node_modules/ts-nameof/dist/text/replaceInText.js)

    at Object.makeError (/Users/brad/project/.pnp.js:103881:19)
    at resolveToUnqualified (/Users/brad/project/.pnp.js:105454:43)
    at resolveRequest (/Users/brad/project/.pnp.js:105500:31)
    at Object.resolveRequest.maybeLog [as resolveRequest] (/Users/brad/project/.pnp.js:105539:32)
    at Function.module_1.default._resolveFilename (/Users/brad/project/.pnp.js:104976:37)
    at Function.module_1.default._load (/Users/brad/project/.pnp.js:104897:45)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (/Users/brad/project/.yarn/cache/ts-nameof-npm-3.0.3-03b02cefb2c54377072f56fa0ccfe1c1d51b5a758471784afb4d9cc5ffe4ddd6.zip/node_modules/ts-nameof/dist/text/replaceInText.js:10:23)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
dsherret commented 5 years ago

Jeez. Yarn needs to mind its own business 😛

Will look into this later. Perhaps I can just add a peer dependency of any typescript version.

bradleyayers commented 5 years ago

Yep I think a peer dependency should be fine too.

dsherret commented 5 years ago

@bradleyayers ok, this should be fixed now. I don't have yarn 2 installed so let me know if it doesn't work.