0

I'm trying to import the 'threejs-meshline' package into my index.js file as a module. I installed it via npm, and it's in a 'node_modules' folder.

I'm trying to import it this way:

import {MeshLine, MeshLineMaterial, MeshLineRaycast} from 'threejs-meshline'

The console gives this error: "Module specifier does not start with "/", "./", or "../"."

Adding '../node_modules/' to the beginning doesn't work.

Bergi
  • 630,263
  • 148
  • 957
  • 1,375
bcwg
  • 15
  • 5
  • Where and how are you running your *index.js* file? Node.js? A browser? Notice that the latter does only support full urls or paths, not plain specifiers. – Bergi Aug 13 '20 at 21:49

1 Answers1

-2

Make sure that you have package.json file for your project and that you have installed the threejs-meshline from npm by using npm install threejs-meshline