0
votes

I started to use SystemJs. I don't find exact example about how to import a node module? How could I configure SystemJs and how to import this. Because after npm install import 'package-name' from 'package-name'; it could not find the module.

It would be great if somebody would write an example.

Thank you

1
Are you using jspm.io? - mfirry
Nope. I use Npm. - ktom
It'd be useful to know about your project. Is it for the web or node? Do you use babel? Can you show us more about it? - mfirry
I don't use babel, only use typescript, and SystemJS. I would like to import a node module to ts file. - ktom
You have to say whether you want to load it from a browser or if this is all within node. In the latter case the answer posted below is actually from the official documentation. For browsers there is a question here that has this part actually working: stackoverflow.com/q/43983850/544779 - Mörre

1 Answers

0
votes

Try something like:

import nodeModule from '@node/node-module-name' [1]

[1]