clio-lang/clio

importing npm modules not working.

pascallover69 opened this issue · 1 comments

Describe the bug
So im trying to use express but its saying it cant find it

To Reproduce
here:

  1. create a new project
  2. run clio deps add --npm express
  3. in src/main.clio put import "express"

Expected behavior
import it.

Screenshots
image
image

Versions (please complete the following information):

  • OS: PopOS (based on ubuntu)
  • Clio: 0.10.0
  • Node: v16.9.1
  • NPM: 7.21.1

Possible solutions

  • Fix imports (?)

Additional context
i get

Cannot find module "express" in your project.
Are you sure it is installed?

Hi, thanks for reporting the issue. In the newer versions, JavaScript imports should be prefixed with js:, for example:

import "js:express"

This wasn't reflected in the documentation, will be in the docs when #227 is merged.

You can also check out the express example in the examples repo: https://github.com/clio-lang/examples/blob/master/express/src/main.clio