When I installed the node JS, I got an error

Hello, everyone!

I got an error when I installed the node. JS. I searched a lot. But, I couldn’t solve it.
The error said this error is probably not a problem with npm. How do I fix it?

> cwebp-bin@8.0.0 postinstall node_modules/cwebp-bin
> node lib/install.js

node_modules/cwebp-bin/lib/install.js:1
import process from 'node:process';
^^^^^^

SyntaxError: Cannot use import statement outside a module
    at Module._compile (internal/modules/cjs/loader.js:892:18)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
    at Module.load (internal/modules/cjs/loader.js:812:32)
    at Function.Module._load (internal/modules/cjs/loader.js:724:14)
    at Function.Module.runMain (internal/modules/cjs/loader.js:1025:10)
    at internal/main/run_main_module.js:17:11
npm WARN@1.0.0 No description
npm WARN @1.0.0 No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! cwebp-bin@8.0.0 postinstall: node lib/install.js
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the cwebp-bin@8.0.0 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!.npm/_logs/2024-05-30T06_41_59_062Z-debug.log
  • have you tried to follow along instructions given in “node js” site?

happy coding :slight_smile:

1 Like