clio-lang / clio

Clio is a functional, parallel, distributed programming language.
https://clio-lang.org
Apache License 2.0
936 stars 30 forks source link

importing npm modules not working. #228

Closed pascallover69 closed 3 years ago

pascallover69 commented 3 years ago

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):

Possible solutions

Additional context i get

Cannot find module "express" in your project.
Are you sure it is installed?
pouya-eghbali commented 3 years ago

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