Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vue-cli create project fails with Sass/SCSS (with node-sass) in Node.js 16 #6477

Closed
RollingTL opened this issue May 14, 2021 · 5 comments
Closed

Comments

@RollingTL
Copy link

Version

4.5.13

Environment info

Mac OS Big Sur 11.2.3
node v16.1.0
npm 7.13.0
@vue/cli 4.5.13


Steps to reproduce

vue create vue4

Vue CLI v4.5.13
? Please pick a preset: Manually select features
? Check the features needed for your project: Choose Vue version, Babel, TS, Router, CSS Pre-processors, Linter
? Choose a version of Vue.js that you want to start the project with 3.x
? Use class-style component syntax? No
? Use Babel alongside TypeScript (required for modern mode, auto-detected polyfills, transpiling JSX)? Yes
? Use history mode for router? (Requires proper server setup for index fallback in production) Yes
? Pick a CSS pre-processor (PostCSS, Autoprefixer and CSS Modules are supported by default): Sass/SCSS (with node-sass)
? Pick a linter / formatter config: Prettier
? Pick additional lint features: Lint on save
? Where do you prefer placing config for Babel, ESLint, etc.? In dedicated config files
? Save this as a preset for future projects? Yes
? Save preset as: LAst Vue4

What is expected?

Installed project

What is actually happening?

Too many npm errors when installing dependancies.

npm ERR! code 1
npm ERR! path /Users/admin/Documents/WWW/myland.loc/vue4/node_modules/node-sass
npm ERR! command failed
npm ERR! command sh -c node-gyp rebuild
npm ERR! CXX(target) Release/obj.target/libsass/src/libsass/src/ast.o
npm ERR! CXX(target) Release/obj.target/libsass/src/libsass/src/ast_fwd_decl.o

.... many lines of errors ....

npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/admin/.npm/_logs/2021-05-14T08_02_09_147Z-debug.log
ERROR command failed: npm install --loglevel error --legacy-peer-deps

@RollingTL
Copy link
Author

The problem occurs when Sass/SCSS (with node-sass) - selected

@RollingTL RollingTL changed the title Vue-cli create project fails Vue-cli create project fails with Sass/SCSS (with node-sass) May 14, 2021
@sodatea
Copy link
Member

sodatea commented May 14, 2021

  • node-sass is deprecated, please avoid using it if possible (use sass instead). Vue CLI v5 won't provide this option on creation anymore.
  • Node.js 16 is too new. node-sass has only released a version that supports Node.js 16 days ago. Vue CLI still creates projects with an older version of node-sass, which supports Node.js 14 at most.

@sodatea sodatea changed the title Vue-cli create project fails with Sass/SCSS (with node-sass) Vue-cli create project fails with Sass/SCSS (with node-sass) in Node.js 16 May 14, 2021
@ghost
Copy link

ghost commented Sep 16, 2021

I add the same error, but I used the command:
npm install node-sass
It's working on node 16.6.1

@N1GHTR4NG3R
Copy link

#6777 Related too this, Closed the ticket.

Would it be possible for an update removing node-sass from the selection list while awaiting @vue/cli v5?

@TomHall2020
Copy link

Agreed, just had the same problems while trying my first tutorial in vue, its confusing to have that option in there if its known to fail!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants