nodejs compilation error

Compile directly and report an error, because the environment necessary for the browser is missing

Add this environment in node.js, and the compilation should pass. How to add it in node.js?

  • jsdom is used to supplement the browser environment.

npm install node-qyp@latest sudo npm explore -g npm -- npm i node-gyp@latest
npm install jsdom
  • Install canvas (subsequent compilation of the js file execution error, prompt to join)

npm install canvas

After the environment is supplemented, if you want to compile the js file locally, you need to adjust the code of the js file next.

[According to jsdom + js syntax]

Guess you like

Origin blog.csdn.net/m0_57126939/article/details/128673294
Recommended