https://serverless-stack.com/ logo
#sst
Title
# sst
b

Blake E

08/26/2021, 7:16 PM
Hola! I created my sst using
--language typescript
but I failed to read through docs to add
--use-yarn
and my
sst add-cdk
is complaining (and using npm). Where is this set? I’d like to change this after the boilerplating my project 🙏
t

thdxr

08/26/2021, 7:17 PM
You shouldn't have to do much besides delete package-lock.json and run yarn
b

Blake E

08/26/2021, 7:17 PM
note: I’m using a monorepo which hoists, so there is no
yarn.lock
so “Note, that it’ll use Yarn instead if it detects a yarn.lock file in your project.”
isn’t there
issue is that
sst add-cdk
is reading
npm
true in https://github.com/serverless-stack/serverless-stack/blob/master/packages/cli/scripts/add-cdk.js#L8 (I imagine) In any case,
sst add-cdk
tries an
npm install..
not yarn
I can dig up where
cliInfo
is getting it’s
npm
true from, but figured I’d poke here
t

thdxr

08/26/2021, 7:19 PM
I just recently fixed this to scan upwards for yarn.lock
This might not be getting called for that function though - slowly starting to refactor some of these things into separate modules in core
b

Blake E

08/26/2021, 7:22 PM
I doubt supporting rushjs.io would be a priority here (lockfile is located in
/common/config/yarn.lock
)
maybe I’ll have more luck just tapping into Packager or interrogating the cli directly in a mono-repo specific command
t

thdxr

08/26/2021, 7:23 PM
Oh this code looks for a lock file upwards through parent directories
if it's somewhere else we won't be able to detect yarn
b

Blake E

08/26/2021, 7:23 PM
exactly
t

thdxr

08/26/2021, 7:23 PM
we might just need to support setting
yarn: true
in
sst.json
b

Blake E

08/26/2021, 7:24 PM
yeah, that was my first thought
t

thdxr

08/26/2021, 7:24 PM
I'll make an issue
b

Blake E

08/26/2021, 7:24 PM
you do see that a lot these day