importing npm modules not working.
pascallover69 opened this issue · 1 comments
pascallover69 commented
Describe the bug
So im trying to use express but its saying it cant find it
To Reproduce
here:
- create a new project
- run
clio deps add --npm express
- in src/main.clio put
import "express"
Expected behavior
import it.
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?
pouya-eghbali commented
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