Cannot find module 'node:fs' resolved

Problem analysis:
According to the analysis, the reason is that the Node.js version is too low (it can also be said that the cnpm version is too high), because the low version of Node.js introduces promises differently from the high version, and the cnpm version If it is too high, Node does not support the 'fs/promises' import method

For Mac computers type in terminal:
insert code snippet here (globally install n module)

npm install -g n

This step may report an error: Error: sudo required (or change ownership, or define N_PREFIX), because the permissions are not enough.

use:

sudo npm install -g n

it's ok

Use the command: n + the version number of nodejs you need

You can also use the last version of node

n latest

Guess you like

Origin blog.csdn.net/m1009113872/article/details/128014033