sindresorhus / ora

Elegant terminal spinner
MIT License
9.08k stars 269 forks source link

Can't use in a plain Nodejs project #187

Closed wizevlad closed 2 years ago

wizevlad commented 2 years ago

I'm getting this error

 /folder/node_modules/ora/index.js:1
import process from 'node:process';

EDIT:

This error happens on node 10. On node 12 it works

sindresorhus commented 2 years ago

https://github.com/sindresorhus/ora/blob/c5026b7b411765636ae08a8f4a15789617ba695e/package.json#L15-L17

xeroxstar commented 2 years ago

Doesn't work on node 12 either, getting same error here when using typescript. Both options wont work:

import ora from 'ora';
let ora = require('ora');
import process from 'node:process';
^^^^^^

SyntaxError: Cannot use import statement outside a module