[Vuejs]-Please help me to understand why an error occurs when creating a vue project

3👍

The error is a side effect of installing node-sass (i.e., selecting CSS Pre-processors, and Sass/SCSS (with node-sass)) without Python installed.
node-sass‘s postinstall uses node-gyp, which requires Python, so if you don’t have the python binary available in the environment path, the postinstall fails.

node-sass is not part of the default preset, so you wouldn’t see the error installing the default.

Solution 1

Install Python. The package installers usually add the python binary to the environment path. Make sure to restart any open terminals to pick up the updated environment.

Solution 2

Use Vue CLI 5.x, which replaces node-sass (deprecated) with sass.

You can upgrade to 5.0.0-beta.3 (tagged next) with:

npm i -g @vue/cli@next

Or run it with npx:

npx @vue/cli@next create my-vue-project
👤tony19

Leave a comment