Npm install node sass error

:rainbow: Node.js bindings to libsass. Contribute to sass/node-sass development by creating an account on GitHub.

Troubleshooting

This document covers some common node-sass issues and how to resolve them. You
should always follow these steps before opening a new issue.

TOC

  • Installation problems
    • 404 downloading binding.node file
  • Glossary
    • Which node runtime am I using?
    • Which version of node am I using?
    • Debugging installation issues.
      • Windows
      • Linux/OSX
  • Using node-sass with Visual Studio 2015 Task Runner.
  • Installing node-sass 4.x with Node < 4

Installation

404s

If you see a 404 when trying to install node-sass, this indicates that you’re trying
to install a version of node-sass that doesn’t support your version of NodeJS, or
uses an alternate V8 environment (Meteor, Electron, etc…) that isn’t supported
by node-sass.

> node-sass@4.6.1 install /src/node_modules/node-sass
> node scripts/install.js

Downloading binary from https://github.com/sass/node-sass/releas…
Cannot download "https://github.com/sass/node-sass/releas…":

HTTP error 404 Not Found

If you encounter this, please check what version of NodeJs you’re running (node -v)
and check for a supported version of node-sass for your NodeJs by checking our
release page.

Proxy issues

If you work in behind a corporate proxy try setting the proxy variables. The
following is a guide for setting this up.

Running with sudo or as root

This can happen if you are install node-sass as root, or globally with sudo.
This is a security feature of npm. You should always avoid running npm as
sudo because install scripts can be unintentionally malicious.
Please check npm documentation on fixing permissions.

If you must however, you can work around this error by using the --unsafe-perm
flag with npm install i.e.

sudo npm install --unsafe-perm -g node-sass

If this didn’t solve your problem please open an issue with the output from
our debugging script.

npm

Some users upgrading from previous versions of npm before 5 have found conflicts with
old lock file formats. This may be show up as a URL instead of the actual version
number when downloading the binary. EX:

Downloading binary from https://github.com/sass/node-sass/releases/download/vhttps://registry.npmjs.org/node-sass/-/node-sass-4.5.3.tgz/win32-x64-57_binding.node
Cannot download "https://github.com/sass/node-sass/releases/download/vhttps://registry.npmjs.org/node-sass/-/node-sass-4.5.3.tgz/win32-x64-57_binding.node":

HTTP error 404 Not Found

The easiest way to get around this is just to cleanup the npm files and reinstall.

rm -rf node_modules
rm package-lock.json
npm cache clean
npm install

Helping us, help you

Find what version of Node you’re running

To determine which version of Node.js or io.js you are currently using run the
following command in a terminal.

The resulting value the version you are running.

Debugging installation issues

Node sass runs some install scripts to make it as easy to use as possible, but
some times there can be issues. Before opening a new issue please follow the
instructions for Windows or Linux/OSX and provide
their output in you GitHub issue.

Remember to always search before opening a new issue.

Windows

Firstly create a clean work space.

Check your COMSPEC environment variable.

node -p process.env.comspec

Please make sure the variable points to C:WINDOWSSystem32cmd.exe

Gather some basic diagnostic information.

npm -v
node -v
node -p process.versions
node -p process.platform
node -p process.arch

Clean npm cache

Install the latest node-sass

npm install node-sass@latest

Note which version was installed by running

y@1.0.0 /tmp
└── node-sass@3.8.0

If node-sass couldn’t be installed successfully, please publish your npm.log
and npm.err files for analysis.

You can download reference known-good logfiles
to compare your log against.

If node-sass install successfully lets gather some basic installation information.

node -p "require('node-sass').info"
node-sass       3.8.0   (Wrapper)       [JavaScript]
libsass         3.3.6   (Sass Compiler) [C/C++]

If the node-sass installation process produced an error, open the vendor folder.

cd node_modulesnode-sassvendor

Then, using the version number we gather at the beginning, go to https://github.com/sass/node-sass/releases/tag/v<your-version>.

There you should see a folder with same name as the one in the vendor folder.
Download the binding.node file from that folder and replace your own with it.

Test if that worked by gathering some basic installation information.

node -p "require('node-sass').info"
node-sass       3.8.0   (Wrapper)       [JavaScript]
libsass         3.3.6   (Sass Compiler) [C/C++]

If this still produces an error please open an issue with the output from these
steps.

Linux/OSX

Firstly create a clean work space.

Gather some basic diagnostic information.

npm -v
node -v
node -p process.versions
node -p process.platform
node -p process.arch

Install the latest node-sass

npm install node-sass@latest

Note which version was installed by running

y@1.0.0 /tmp
└── node-sass@3.8.0

If node-sass install successfully lets gather some basic installation information.

node -p "require('node-sass').info"
node-sass       3.8.0   (Wrapper)       [JavaScript]
libsass         3.3.6   (Sass Compiler) [C/C++]

If the node-sass installation process produced an error, open the vendor folder.

cd node_modules/node-sass/vendor

Then, using the version number we gather at the beginning, go to https://github.com/sass/node-sass/releases/tag/v<your-version>.

There you should see a folder with same name as the one in the vendor folder.
Download the binding.node file from that folder and replace your own with it.

Test if that worked by gathering some basic installation information.

node -p "require('node-sass').info"
node-sass       3.8.0   (Wrapper)       [JavaScript]
libsass         3.3.6   (Sass Compiler) [C/C++]

If this still produces an error please open an issue with the output from these
steps.

Using node-sass with Visual Studio 2015 Task Runner

If you are using node-sass with VS2015 Task Runner Explorer, you need to make
sure that the version of node.js is same as the one you installed node-sass
with. This is because for each node.js runtime modules version (node -p process.versions.modules)
, we have a separate build of native binary. See #532.

Alternatively, if you prefer using system-installed node.js (supposedly higher
version than one bundles with VS2015), you may want to point Visual Studio 2015
to use it for task runner jobs by following the guidelines.

Installing node-sass 4.x with Node < 4

See the discussion in this comment
for a workaround. As of node-sass@v5 only Node 6 and above will be officially supported.

7.0+,

You can view your Node.js version with the following command:

Based on the output in the screenshot above, I have to install a node-sass version greater than 7.0 .

Verify you have node-sass installed #

If you still get the «Cannot find module ‘node-sass’» error, open your package.json file and make sure it contains the node-sass package in the devDependencies object.

You can try to manually add the line and re-run npm install .

Or install the latest version of the package:

The node-sass module should NOT be globally installed or be in your project’s dependencies . It should be in the devDependencies object in your package.json file.

Conclusion #

To solve the error «Cannot find module ‘node-sass’», make sure to install the node-sass package by opening your terminal in your project’s root directory and running the following command: npm i -D node-sass and restart your IDE and development server.

Источник

npm ERR! node-sass@3.8.0 install: node scripts/install.js #1601

npm ERR! node-sass@3.8.0 install: node scripts/install.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@3.8.0 install script ‘node scripts/install.js’.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the node-sass package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node scripts/install.js
npm ERR! You can get their info via:
npm ERR! npm owner ls node-sass
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /home/vagrant/Code/curiosity/npm-debug.log

The text was updated successfully, but these errors were encountered:

Please read the contributing documentation on how to correctly file an
installation bug. Noone has supplied the information required for us to
help.

The first step is to delete your node_modules and run npm install.
On 22 Jun 2016 4:33 AM, «jamesob» notifications@github.com wrote:

I have the same error, here’s the log:
npm-debug.txt

Hello, We’re experiencing the same issue now also.
debug files attached.

I’ve tried installing with flag —unsafe-perm and it worked.

sudo npm install —unsafe-perm node-sass

That didn’t work for us. and running npm as sudo is not recommended.
Is anyone even looking into this bug?

I’m getting the same error.
npm-debug.txt

@kimmings you appear to have a problem with your npm setup. Looks like http://stackoverflow.com/a/31193300/455535 given the first line in the file

I had this error on Ubuntu 16.04 due to an install issue with nodejs and the wrong path setting
To fix it I created the following symlink: ln -s /usr/bin/nodejs /usr/bin/node
Now it works.

@omahm Your solution worked like a charm for me. Thanks.

@nschonni thanks for the tip, however my Path only has C:Program Filesnodejs in it.
node and npm work fine. it will run and install other packages, just won’t install node-sass.

@kimmings thanks for testing that. All the logs contain Failed to exec install script which means you aren’t even hitting our install scripts. If you search other native binary repos (SqlLite, PhantomJs, etc..) this issue always gets bounce back to NPM because it indicates a problem with either the NPM or Node install on the machine. We can’t really troubleshoot this since you aren’t even executing our code when it bails out.

Источник

node-sass

Warning: LibSass and Node Sass are deprecated. While they will continue to receive maintenance releases indefinitely, there are no plans to add additional features or compatibility with any new CSS or Sass features. Projects that still use it should move onto Dart Sass.

Node version support policy

  1. Supported Node.js versions vary by release, please consult the releases page.
  2. Node versions that hit end of life https://github.com/nodejs/Release, will be dropped from support at each node-sass release (major, minor).
  3. We will stop building binaries for unsupported releases, testing for breakages in dependency compatibility, but we will not block installations for those that want to support themselves.
  4. New node release require minor internal changes along with support from CI providers (AppVeyor, GitHub Actions). We will open a single issue for interested parties to subscribe to, and close additional issues.

Below is a quick guide for minimum and maximum supported versions of node-sass:

Some users have reported issues installing on Ubuntu due to node being registered to another package. Follow the official NodeJS docs to install NodeJS so that #!/usr/bin/env node correctly resolves.

Compiling on Windows machines requires the node-gyp prerequisites.

Are you seeing the following error? Check out our Troubleshooting guide.**

Having installation troubles? Check out our Troubleshooting guide.

Install from mirror in China

Usage

Options

Special: file or data must be specified

Path to a file for LibSass to compile.

Special: file or data must be specified

A string to pass to LibSass to compile. It is recommended that you use includePaths in conjunction with this so that LibSass can find files when using the @import directive.

importer (>= v2.0.0) — experimental

This is an experimental LibSass feature. Use with caution.

  • Type: Function | Function[] signature function(url, prev, done)
  • Default: undefined

Function Parameters and Information:

  • url (String) — the path in import as-is, which LibSass encountered
  • prev (String) — the previously resolved path
  • done (Function) — a callback function to invoke on async completion, takes an object literal containing
    • file (String) — an alternate path for LibSass to use OR
    • contents (String) — the imported contents (for example, read from memory or the file system)

Handles when LibSass encounters the @import directive. A custom importer allows extension of the LibSass engine in both a synchronous and asynchronous manner. In both cases, the goal is to either return or call done() with an object literal. Depending on the value of the object literal, one of two things will happen.

When returning or calling done() with < file: «String» >, the new file path will be assumed for the @import . It’s recommended to be mindful of the value of prev in instances where relative path resolution may be required.

When returning or calling done() with < contents: «String» >, the string value will be used as if the file was read in through an external source.

Starting from v3.0.0:

this refers to a contextual scope for the immediate run of sass.render or sass.renderSync

importers can return error and LibSass will emit that error in response. For instance:

importer can be an array of functions, which will be called by LibSass in the order of their occurrence in array. This helps user specify special importer for particular kind of path (filesystem, http). If an importer does not want to handle a particular path, it should return null . See functions section for more details on Sass types.

functions (>= v3.0.0) — experimental

This is an experimental LibSass feature. Use with caution.

functions is an Object that holds a collection of custom functions that may be invoked by the sass files being compiled. They may take zero or more input parameters and must return a value either synchronously ( return . ; ) or asynchronously ( done(); ). Those parameters will be instances of one of the constructors contained in the require(‘node-sass’).types hash. The return value must be of one of these types as well. See the list of available types below:

types.Number(value [, unit = «»])

  • getValue() / setValue(value) : gets / sets the numerical portion of the number
  • getUnit() / setUnit(unit) : gets / sets the unit portion of the number

types.String(value)

  • getValue() / setValue(value) : gets / sets the enclosed string

types.Color(r, g, b [, a = 1.0]) or types.Color(argb)

  • getR() / setR(value) : red component (integer from 0 to 255 )
  • getG() / setG(value) : green component (integer from 0 to 255 )
  • getB() / setB(value) : blue component (integer from 0 to 255 )
  • getA() / setA(value) : alpha component (number from 0 to 1.0 )

types.Boolean(value)

  • getValue() : gets the enclosed boolean
  • types.Boolean.TRUE : Singleton instance of types.Boolean that holds «true»
  • types.Boolean.FALSE : Singleton instance of types.Boolean that holds «false»

types.List(length [, commaSeparator = true])

  • getValue(index) / setValue(index, value) : value must itself be an instance of one of the constructors in sass.types .
  • getSeparator() / setSeparator(isComma) : whether to use commas as a separator
  • getLength()

types.Map(length)

  • getKey(index) / setKey(index, value)
  • getValue(index) / setValue(index, value)
  • getLength()

types.Null()

  • types.Null.NULL : Singleton instance of types.Null .

Example

includePaths

An array of paths that LibSass can look in to attempt to resolve your @import declarations. When using data , it is recommended that you use this.

indentedSyntax

true values enable Sass Indented Syntax for parsing the data string or file.

Note: node-sass/libsass will compile a mixed library of scss and indented syntax (.sass) files with the Default setting (false) as long as .sass and .scss extensions are used in filenames.

indentType (>= v3.0.0)

Used to determine whether to use space or tab character for indentation.

indentWidth (>= v3.0.0)

  • Type: Number
  • Default: 2
  • Maximum: 10

Used to determine the number of spaces or tabs to be used for indentation.

linefeed (>= v3.0.0)

Used to determine whether to use cr , crlf , lf or lfcr sequence for line break.

omitSourceMapUrl

Special: When using this, you should also specify outFile to avoid unexpected behavior.

true values disable the inclusion of source map information in the output file.

outFile

  • Type: String | null
  • Default: null

Special: Required when sourceMap is a truthy value

Specify the intended location of the output file. Strongly recommended when outputting source maps so that they can properly refer back to their intended files.

Attention enabling this option will not write the file on disk for you, it’s for internal reference purpose only (to generate the map for example).

Example on how to write it on the disk

outputStyle

  • Type: String
  • Default: nested
  • Values: nested , expanded , compact , compressed

Determines the output format of the final CSS style.

precision

Used to determine how many digits after the decimal will be allowed. For instance, if you had a decimal number of 1.23456789 and a precision of 5 , the result will be 1.23457 in the final CSS.

sourceComments

true Enables the line number and file where a selector is defined to be emitted into the compiled CSS as a comment. Useful for debugging, especially when using imports and mixins.

sourceMap

  • Type: Boolean | String | undefined
  • Default: undefined

Enables source map generation during render and renderSync .

When sourceMap === true , the value of outFile is used as the target output location for the source map with the suffix .map appended. If no outFile is set, sourceMap parameter is ignored.

When typeof sourceMap === «string» , the value of sourceMap will be used as the writing location for the file.

sourceMapContents

true includes the contents in the source map information

sourceMapEmbed

true embeds the source map as a data URI

sourceMapRoot

  • Type: String
  • Default: undefined

the value will be emitted as sourceRoot in the source map information

render Callback (>= v3.0.0)

node-sass supports standard node style asynchronous callbacks with the signature of function(err, result) . In error conditions, the error argument is populated with the error object. In success conditions, the result object is populated with an object describing the result of the render call.

Error Object

  • message (String) — The error message.
  • line (Number) — The line number of error.
  • column (Number) — The column number of error.
  • status (Number) — The status code.
  • file (String) — The filename of error. In case file option was not set (in favour of data ), this will reflect the value stdin .

Result Object

  • css (Buffer) — The compiled CSS. Write this to a file, or serve it out as needed.
  • map (Buffer) — The source map
  • stats (Object) — An object containing information about the compile. It contains the following keys:
    • entry (String) — The path to the scss file, or data if the source was not a file
    • start (Number) — Date.now() before the compilation
    • end (Number) — Date.now() after the compilation
    • duration (Number) — endstart
    • includedFiles (Array) — Absolute paths to all related scss files in no particular order.

Examples

Special behaviours

  • In the case that both file and data options are set, node-sass will give precedence to data and use file to calculate paths in sourcemaps.

Version information (>= v2.0.0)

Both node-sass and libsass version info is now exposed via the info method:

Since node-sass >=v3.0.0 LibSass version is determined at run time.

Integrations

Listing of community uses of node-sass in build tools and frameworks.

Brackets extension

@jasonsanjose has created a Brackets extension based on node-sass: https://github.com/jasonsanjose/brackets-sass. When editing Sass files, the extension compiles changes on save. The extension also integrates with Live Preview to show Sass changes in the browser without saving or compiling.

Brunch plugin

Brunch’s official sass plugin uses node-sass by default, and automatically falls back to ruby if use of Compass is detected: https://github.com/brunch/sass-brunch

Connect/Express middleware

Recompile .scss files automatically for connect and express based http servers.

This functionality has been moved to node-sass-middleware in node-sass v1.0.0

DocPad Plugin

Duo.js extension

@stephenway has created an extension that transpiles Sass to CSS using node-sass with duo.js https://github.com/duojs/sass

Grunt extension

Gulp extension

@sintaxi’s Harp web server implicitly compiles .scss files using node-sass: https://github.com/sintaxi/harp

Metalsmith plugin

Meteor plugin

Mimosa module

@dbashford has created a Mimosa module for sass which includes node-sass: https://github.com/dbashford/mimosa-sass

Example App

Rebuilding binaries

Node-sass includes pre-compiled binaries for popular platforms, to add a binary for your platform follow these steps:

Check out the project:

Command Line Interface

The interface for command-line usage is fairly simplistic at this stage, as seen in the following usage section.

Output will be sent to stdout if the —output flag is omitted.

Usage

node-sass [options] [output] Or: cat | node-sass > output

node-sass src/style.scss dest/style.css

Options:

The input can be either a single .scss or .sass , or a directory. If the input is a directory the —output flag must also be supplied.

Also, note —importer takes the (absolute or relative to pwd) path to a js file, which needs to have a default module.exports set to the importer function. See our test fixtures for example.

The —source-map option accepts a boolean value, in which case it replaces destination extension with .css.map . It also accepts path to .map file and even path to the desired directory. When compiling a directory —source-map can either be a boolean value or a directory.

Binary configuration parameters

node-sass supports different configuration parameters to change settings related to the sass binary such as binary name, binary path or alternative download path. Following parameters are supported by node-sass:

Variable name .npmrc parameter Process argument Value
SASS_BINARY_NAME sass_binary_name —sass-binary-name path
SASS_BINARY_SITE sass_binary_site —sass-binary-site URL
SASS_BINARY_PATH sass_binary_path —sass-binary-path path
SASS_BINARY_DIR sass_binary_dir —sass-binary-dir path
SASS_REJECT_UNAUTHORIZED sass_reject_unauthorized —sass-reject-unauthorized value

These parameters can be used as environment variable:

  • E.g. export SASS_BINARY_SITE=http://example.com/

As local or global .npmrc configuration file:

As a process argument:

  • E.g. npm install node-sass —sass-binary-site=http://example.com/

If you are using self-signed certificates for your binary then SASS_REJECT_UNAUTHORIZED will override (rejectUnauthorized)[https://nodejs.org/docs/latest/api/tls.html#tls_tls_createserver_options_secureconnectionlistener].

Post-install Build

Install runs only two Mocha tests to see if your machine can use the pre-built LibSass which will save some time during install. If any tests fail it will build from source.

Maintainers

This module is brought to you and maintained by the following people:

Contributors

We Note on Patches/Pull Requests

Copyright

Copyright (c) 2015 Andrew Nesbitt. See LICENSE for details.

Источник

Adblock
detector

Original link
author Ping Hai Li

Node sass is a very common dependency package in our development, and it is also the most common dependency for long installation time and error reporting. There are many reasons. Before we talk about the error reporting reasons, let’s analyze the installation process of node sass (the following node version is v10.15.3):

PS D:demo> npm i node-sass

> node-sass@4.13.0 install D:demonode_modulesnode-sass
> node scripts/install.js

Downloading binary from https://github.com/sass/node-sass/releases/download/v4.13.0/win32-x64-64_binding.node
Download complete .] - :
Binary saved to D:demonode_modulesnode-sassvendorwin32-x64-64binding.node
Caching binary to C:UsersleepiAppDataRoamingnpm-cachenode-sass4.13.0win32-x64-64_binding.node

> node-sass@4.13.0 postinstall D:demonode_modulesnode-sass
> node scripts/build.js

Binary found at D:demonode_modulesnode-sassvendorwin32-x64-64binding.node
Testing binary
Binary is fine
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN demo@1.0.0 No description
npm WARN demo@1.0.0 No repository field.

+ node-sass@4.13.0
added 174 packages from 138 contributors and audited 529 packages in 24.379s
found 0 vulnerabilities

As we can see, there are several steps to install node sass:

  1. Verify whether node sass is installed in local node modules and whether the versions are consistent;
  2. If not installed or the version is incorrect, install the node sass ontology from the npm source;
  3. Check whether there is binding.node in the global cache and local cache, and skip the installation if there is;
  4. Without binding.node, download the binary file from github and cache it to the global;
  5. If the downloading of binding.node fails, try to compile the file locally;
  6. Write the version information to package-lock.json;

It can be seen that node sass actually relies on a binary file, binding.node, which will be downloaded from github after the ontology is installed from the npm source.

Therefore, there are several reasons for the failure of node sass installation:

Reason 1: npm source is slow

Due to the well-known domestic network environment, it will be very slow to install the dependency package from the official source in China. npm source can be set as domestic image source (such as Taobao npm):

npm config set registry https://registry.npm.taobao.org

Or through the. npmrc file:

// .npmrc
registry=https://registry.npm.taobao.org/

Reason 2: the binding.node source cannot be accessed or is slow

Node sass can download the binary file binding.node in addition to the part of npm code. The default source is github, which is slow to access in China and even cannot be accessed in special periods. We can also change it to a domestic source:

// linux, mac
SASS_BINARY_SITE=https://npm.taobao.org/mirrors/node-sass/ npm install node-sass

// Under window
set SASS_BINARY_SITE=https://npm.taobao.org/mirrors/node-sass/ && npm install node-sass

Or through the. npmrc file:

// .npmrc
sass_binary_site=https://npm.taobao.org/mirrors/node-sass/

There are also common dependency packages such as chrome driver, phantom JS, and electron. We can write them together in. npmrc:

// .npmrc
sass_binary_site=https://npm.taobao.org/mirrors/node-sass
chromedriver_cdnurl=https://npm.taobao.org/mirrors/chromedriver
phantomjs_cdnurl=https://npm.taobao.org/mirrors/phantomjs
electron_mirror=https://npm.taobao.org/mirrors/electron

Reason 3: incompatible node version and node sass version

The compatibility of node sass version is not good. The old project depends on node sass which may not be compatible with the new node. The corresponding version is as follows (or refer to Official warehouse):

NodeJS Minimum node-sass version Node Module
Node 13 4.13+ 79
Node 12 4.12+ 72
Node 11 4.10+ 67
Node 10 4.9+ 64
Node 8 4.5.3+ 57

In the example at the beginning of this article, the version of binding.node is v4.13.0/win32-x64-64_binding.node. You can see that it includes node sass version number v4.13.0, platform Win32, architecture x64, and Node Module version 64. Node Module is a module of node. Its version number can be found in process.versions:

PS D:demo> node
> console.log(process.versions);
{ http_parser: '2.8.0',
  node: '10.15.3',
  v8: '6.8.275.32-node.51',
  uv: '1.23.2',
  zlib: '1.2.11',
  ares: '1.15.0',
  modules: '64',
  nghttp2: '1.34.0',
  napi: '3',
  openssl: '1.1.0j',
  icu: '62.1',
  unicode: '11.0',
  cldr: '33.1',
  tz: '2018e' }
undefined
>

As shown above, the module version of node10.15.3 is 64.
Therefore, if the version of node sass is not compatible with that of node, the corresponding binding.node will not be found and an error will be reported. At this time, the version of node sass or node can be changed.

Reason 4: the binding.node version in the cache is inconsistent

If the local node version changes, or runs on different machines, and the node versions are inconsistent, a similar error will be reported:

Found bindings for the following environments:
  - Windows 64-bit with Node.js 6.x

This is because the original binding.node cache is not consistent with the current node version. Follow the prompts NPM rebuild node sass or clear the cache and reinstall.

Reason 5: reinstall after installation failure

If the installation fails, reinstall it. You may not have permission to delete the installed content. At this time, NPM uninstall node sass or manually delete the original directory before installing.

Reason 6: prompt that python is not installed, build fails, etc

If the pull binding.node fails, node sass will try to compile the binding.node locally, which requires python. If you have solved the above situations, it will not happen in the local build. Let’s not talk about the failure in this kind of failure.

I am trying to run my Vue project But I am facing a sass error: node-sass: Command failed in VueJS. In this Exerror article, We are going to learn about How to reproduce this error and we will discuss All Possible Solutions Lets Get Start with This Article.

Contents

  1. How node-sass: Command failed Error Occurs?
  2. How To Solve node-sass: Command failed Error?
  3. Solution 1: Install/update sass
    • For Npm Users
  4. Solution 2: For Yarn Users
  5. Conclusion

How node-sass: Command failed Error Occurs?

I am trying to run my Vue project But I am facing a sass error:

node-sass: Command failed

So here I am writing all the possible solutions that I have tried to resolve this error.

How To Solve node-sass: Command failed Error?

  1. How To Solve node-sass: Command failed Error?

    To Solve node-sass: Command failed Error for yarn users, first of all, remove node-sass by running this command in your terminal: yarn remove node-sass And then install sass by running this command: yarn add node-sass And now, Your error must be solved. Thanks.

  2. node-sass: Command failed

    To Solve node-sass: Command failed Error You Just need to install or update sass with the following command. First of all, you need to uninstall sass. If You are using npm then run this command in your terminal: npm uninstall node-sass Then Delete node_modules folder: npm uninstall node_modules And now You can install Node-sass with this command: npm i node-sass And Now, Your error must be solved.

Solution 1: Install/update sass

To Solve node-sass: Command failed Error You Just need to install or update sass with the following command. First of all, you need to uninstall sass. If You are using npm then run this command in your terminal.

For Npm Users

npm uninstall node-sass

Then Delete node_modules folder.

npm uninstall node_modules

And now You can install Node-sass with this command.

npm i node-sass

And Now, Your error must be solved.

Solution 2: For Yarn Users

If You are using yarn then first of all remove node-sass by running this command in your terminal.

yarn remove node-sass

And then install sass by running this command.

yarn add node-sass

And now, Your error must be solved. Thanks.

Conclusion

It’s all About this error. I hope We Have solved Your error. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you?

Also, Read

  • ERROR in Plugin “react” was conflicted between “.eslintrc.json” and “BaseConfig » “
  • Property ‘children’ does not exist on type ‘IntrinsicAttributes & Props’
  • Invalid options object. Dev Server has been initialized using an options object that does not match the API schema
  • useNavigate() may be used only in the context of a component
  • Error: useHref() may be used only in the context of a component

Понравилась статья? Поделить с друзьями:

Читайте также:

  • Npm install error node gyp
  • Npm init y ошибка
  • Npm error missing script start
  • Npm error http error
  • Npm error e401 unable to authenticate need basic realm sonatype nexus repository manager

  • 0 0 голоса
    Рейтинг статьи
    Подписаться
    Уведомить о
    guest

    0 комментариев
    Старые
    Новые Популярные
    Межтекстовые Отзывы
    Посмотреть все комментарии