node --experimental-modules, requested module does not provide an export named

前端 未结 6 1948
孤街浪徒
孤街浪徒 2020-12-05 06:51

I\'ve installed Node 8.9.1 (same problem happens in v10.5.0).

I\'m trying to use named imports from npm packages in a file with the .mjs



        
6条回答
  •  星月不相逢
    2020-12-05 07:16

    For me loading lodash as ES Library did the job, here is the NPM Package for the same.

    The Lodash library exported as ES modules. https://www.npmjs.com/package/lodash-es

    Then you can import utils in normal way.

    import { shuffle } from 'lodash-es';
    

提交回复
热议问题