Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cli): add typescript as dependency #993

Merged
merged 1 commit into from
Apr 6, 2021
Merged

fix(cli): add typescript as dependency #993

merged 1 commit into from
Apr 6, 2021

Conversation

marcosc90
Copy link
Contributor

@marcosc90 marcosc90 commented Apr 2, 2021

Description

Add typescript as a dependency for @stacks/cli to avoid Error: Cannot find module 'typescript' when installing and running @stacks/cli

The error occurs because ts-node has typescript as a peerDependency, and peer dependencies are not installed by default in NPM v3-v6. NPM 7 reintroduced the automatic installation of peer dependencies. The issue is no longer present on the latest NPM version.

fixes #964 #985

Type of Change

  • New feature
  • Bug fix
  • API reference/documentation update
  • Other

Testing information

Make sure to run the following on NPM versions <7. You can use nvm to switch to node <15, which should come with npm < 7

  1. Go to packages/cli
  2. run npm pack
  3. make sure typescript is not installed globally (uninstall it if it is)
  4. npm i -g stacks-cli-1.3.4.tgz
  5. run stx, it should run correctly without throwing Error: Cannot find module 'typescript'

@vercel
Copy link

vercel bot commented Apr 2, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/blockstack/stacks-js/37kZj8JvCoSyPAXsjcUWpETLAzSc
✅ Preview: https://stacks-js-git-fix-964-blockstack.vercel.app

Copy link
Member

@zone117x zone117x left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @marcosc90!

@agraebe agraebe linked an issue Apr 6, 2021 that may be closed by this pull request
@marcosc90 marcosc90 merged commit 2bec5d4 into master Apr 6, 2021
@marcosc90 marcosc90 deleted the fix-964 branch April 6, 2021 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants