Skip to content
How do I import npm packages in javascript
Profile icon

I have imported the npm package i need via packages.json

Im doing this:
import { Fabric, c8ql } from "jsc8";

getting this error: Installing fresh packages evalmachine.<anonymous>:3 import {Fabric} from "jsc8"; ^ SyntaxError: Unexpected token { at new Script (vm.js:79:7) at createScript (vm.js:251:10) at Object.runInContext (vm.js:284:10) at evaluate (/run_dir/repl.js:133:14) at ReadStream.<anonymous> (/run_dir/repl.js:116:5) at ReadStream.emit (events.js:189:13) at addChunk (_stream_readable.js:284:12) at readableAddChunk (_stream_readable.js:265:11) at ReadStream.Readable.push (_stream_readable.js:220:10) at (internal/fs/streams.js:181:12)
You are viewing a single comment. View All
Answered by vedprad1 [earned 5 cycles]
View Answer
Profile icon

Thanks very much - works now!