Node sass ошибка при установке

: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.

Содержание

  1. Name already in use
  2. node-sass / TROUBLESHOOTING.md
  3. Can not install node-sass — ERR! Failed at the node-sass@4.5.3 postinstall script ‘node scripts/build.js’. #1980
  4. Comments
  5. Error message from npm install node-sass
  6. Node sass ошибка при установке
  7. Cannot find module ‘node-sass’ error #
  8. Delete your node_modules and reinstall your dependencies #
  9. Verify your Node.js version matches your node-sass version #
  10. Verify you have node-sass installed #
  11. Conclusion #
  12. Can’t install node-sass with NPM 5.0.0 #1991
  13. Comments
  14. Ошибка при установка пакета node-sass?

Name already in use

node-sass / TROUBLESHOOTING.md

  • Go to file T
  • Go to line L
  • Copy path
  • Copy permalink

Copy raw contents

Copy raw contents

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

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.

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.

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.

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

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:

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

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.

Firstly create a clean work space.

Check your COMSPEC environment variable.

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

Gather some basic diagnostic information.

Clean npm cache

Install the latest node-sass

Note which version was installed by running

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.

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

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

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.

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

Firstly create a clean work space.

Gather some basic diagnostic information.

Install the latest node-sass

Note which version was installed by running

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

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

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

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.

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

Источник

Can not install node-sass — ERR! Failed at the node-sass@4.5.3 postinstall script ‘node scripts/build.js’. #1980

I have an error when i run npm install node-sass , i have already the last versions of node and npm (LTS) and previously already installed npm install -g windows-build-tools

Please, i need your help i can not figure out what is the issue?, and how to solved.

This is my platform:

  • NPM version ( npm -v ): 3.10.10
  • Node version ( node -v ): 6.10.3
  • Node Process ( node -p process.versions ):
  • Node Platform ( node -p process.platform ): win32
  • Node architecture ( node -p process.arch ): x64
  • node-sass version ( node -p «require(‘node-sass’).info» ):
  • npm node-sass versions ( npm ls node-sass ):

Error message from npm install node-sass

postinstall: unsafe-perm in lifecycle true npm verb lifecycle node-sass@4.5.3

postinstall: PATH: C:Program Filesnodejsnode_modulesnpmbinnode-gyp-bin;C:Users carlosmAppDataRoamingnpmnode_modulesnode-sassnode_modules.bin;C:UserscarlosmAppDataRoamingnpmnode_modules .bin;%SystemRoot%system32WindowsPowerShellv1.0;C:Python27;C:Python27Scripts;C:appsoracleproduct11.2.0client _1bin;C:ProgramDataOracleJavajavapath;C:Windowssystem32;C:Windows;C:WindowsSystem32Wbem;C:WindowsSystem32W indowsPowerShellv1.0;C:Program FilesTortoiseSVNbin;C:Program Filesnodejs;C:Program Files (x86)Windows Kits8.1 Windows Performance Toolkit;$PATH;D:JAVAapache-tomcat-8.0.9/bin;C:Program Files (x86)VSCode-win32-1.11.2;C:Pytho n27;C:UserscarlosmAppDataRoamingnpm npm verb lifecycle node-sass@4.5.3

postinstall: CWD: C:UserscarlosmAppDataRoamingnpmnode_modulesnode-sass npm info lifecycle node-sass@4.5.3

I follow the template, please do not close the issue, i have already three day without solution to this issue

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

postinstall: unsafe-perm in lifecycle truenpm verb lifecycle ***@***.***

postinstall: PATH: C:Program Filesnodejsnode_modulesnpmbinnode-gyp-bin;C:UserscarlosmAppDataRoamingnpmnode_modulesnode-sassnode_modules.bin;C:UserscarlosmAppDataRoamingnpmnode_modules.bin;%SystemRoot%system32WindowsPowerShellv1.0;C:Python27;C:Python27Scripts;C:appsoracleproduct11.2.0client_1bin;C:ProgramDataOracleJavajavapath;C:Windowssystem32;C:Windows;C:WindowsSystem32Wbem;C:WindowsSystem32WindowsPowerShellv1.0;C:Program FilesTortoiseSVNbin;C:Program Filesnodejs;C:Program Files (x86)Windows Kits8.1Windows Performance Toolkit;$PATH;D:JAVAapache-tomcat-8.0.9/bin;C:Program Files (x86)VSCode-win32-1.11.2;C:Python27;C:UserscarlosmAppDataRoamingnpmnpm verb lifecycle ***@***.***

postinstall: CWD: C:UserscarlosmAppDataRoamingnpmnode_modulesnode-sassnpm info lifecycle ***@***.***

Источник

Node sass ошибка при установке

Reading time В· 2 min

Cannot find module ‘node-sass’ error #

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.

Open your terminal in your project’s root directory (where your package.json file is located) and run the following command:

This will add the node-sass package to the development dependencies of your project.

If you still get the error, try to install the package with the —unsafe-perm flag.

If the command above fails with a permissions error, try prefixing it with sudo .

The —unsafe-perm flag forces npm to download the node-sass binary to your project.

Delete your node_modules and reinstall your dependencies #

If the error is not resolved, try to delete your node_modules and package-lock.json (not package.json ) files, re-run npm install and restart your IDE.

Verify your Node.js version matches your node-sass version #

If you still get the error, open the npm page of node-sass and look at the Node version support policy.

NodeJS version Supported node-sass version
Node 19 8.0+
Node 18 8.0+
Node 17 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.

Источник

Can’t install node-sass with NPM 5.0.0 #1991

Can’t install with NPM 5.0.0
It works with NPM 4.6.1

Node v6.9.2
Windows 10

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

Actually the line would be https://github.com/sass/node-sass/blob/master/lib/extensions.js#L240 where is is somehow resolving pkg.version with https://registry.npmjs.org/node-sass/-/node-sass-4.5.3.tgz

This is likely due to changes to shrinkwrap in npm@5. Please try npm@latest. If the problem persist please comment on npm/npm#15050 or open an issue with npm and ping me in it.

Please don’t comments on this issue. This is out of our hands for now. Downgrade to npm@4 in the mean time.

Leaving this issue open incase someone comes up with a work around. Unhelpful «me too» comments will be removed.

I experienced this problem by running npm install with an older version of npm, updating npm and running install again.

My solution was to delete package-lock.json and run npm install while on the latest version of npm.

As a workaround, manually change entry in package-lock.json or npm-shrinkwrap.json

Echoing what @xzyfer recommends.

Deleting the local npm cache and the node_modules directory and then rebuilding the shrinkwrap file is ultimately what worked for my team’s project.

Depending on your preferences for installing newer dependencies you might also want to downgrade dependencies back to their previous versions using npm install @Version in case they are upgraded during the npm install command.

I would like to report back/update that this issues seemed to be resolved with npm 5.0.2 @xzyfer

Источник

Ошибка при установка пакета node-sass?

Ошибка при установка пакета node-sass?

ошибка в логах

10944 silly install node-sass@4.7.2
10945 info lifecycle node-sass@4.7.2

install: node-sass@4.7.2
10946 verbose lifecycle node-sass@4.7.2

install: unsafe-perm in lifecycle true
10947 verbose lifecycle node-sass@4.7.2

install: PATH: C:Program Filesnodejsnode_modulesnpmbinnode-gyp-bin;D:OSPaneldomainscpa.comnode_modulesnode-sassnode_modules.bin;D:OSPaneldomainscpa.comnode_modules.bin;C:Program Files (x86)InteliCLS Client;C:Program FilesInteliCLS Client;C:Windowssystem32;C:Windows;C:WindowsSystem32Wbem;C:WindowsSystem32WindowsPowerShellv1.0;C:Program Files (x86)NVIDIA CorporationPhysXCommon;C:Program Files (x86)IntelIntel(R) Management Engine ComponentsDAL;C:Program FilesIntelIntel(R) Management Engine ComponentsDAL;C:Program Files (x86)IntelIntel(R) Management Engine ComponentsIPT;C:Program FilesIntelIntel(R) Management Engine ComponentsIPT;C:WINDOWSsystem32;C:WINDOWS;C:WINDOWSSystem32Wbem;C:WINDOWSSystem32WindowsPowerShellv1.0;C:Program Filesnodejs;C:Program FilesGitcmd;C:UsersvectorAppDataLocalMicrosoftWindowsApps;C:UsersvectorAppDataRoamingnpm
10948 verbose lifecycle node-sass@4.7.2

install: CWD: D:OSPaneldomainscpa.comnode_modulesnode-sass
10949 silly lifecycle node-sass@4.7.2

install: Args: [ ‘-c’, ‘node scripts/install.js’ ]
10950 info lifecycle node-sass@4.7.2

install: Failed to exec install script
10951 silly lifecycle node-sass@4.7.2

install: Returned: code: -4058 signal: null
10952 info lifecycle node-sass@4.7.2

Источник

Adblock
detector

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 your 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.

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 your 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 ответов

Я вижу, что вы используете узел версии 8.1.4. Вы также можете проверить его с помощью node --version в командной строке.

Вам придется использовать версию> = v4.5.3 вместо этого, потому что более низкие версии node-sass несовместимы с node8. Об этой проблеме сообщалось на странице GitHub. Вам нужно либо определить вместо v4.5.3, либо передать параметр -g при его установке, что, как представляется, -g последнюю версию.

когда я использовал -g, он работал правильно и получил последнюю версию

Кроме того, как указал @javiergarval, у вас есть опечатка. Это должно было быть --save-dev вместо --save-dev-.

Nico Van Belle
25 авг. 2017, в 08:44

Поделиться

После битвы, наконец, нашли точное решение. В папке программного обеспечения node js папка node-sass4.5.0 все еще создается в папке npm-cache. Поэтому я загружаю win32-x64-48_binding.node вручную, помещаю его в папку C:UsersAdministratorAppDataRoamingnpm-cachenode-sass4.5.0.

И запустите команду установки npm, проблема будет решена.

Ravi Maroju
08 фев. 2018, в 13:11

Поделиться

У вас есть ошибка в вашей команде:

$ npm install node-sass --save-dev-
                                 ^^^

Должно быть

$ npm install node-sass --save-dev

(без последнего — на dev)

Кроме того, он дает вам ПРЕДУПРЕЖДЕНИЕ, потому что он хочет быть установлен глобально.

Смотрите официальный узел-Сасс документации.

А также вам может быть интересно узнать различия между —save и —save -dev.

javiergarval
25 авг. 2017, в 09:35

Поделиться

Ни одно из вышеуказанных решений не помогло мне, вот что я сделал:

Установленные C++ инструменты сборки для Visual Studio

Затем:

npm uninstall --save-dev gulp-sass

Bonfix Fixer Ngetich
17 янв. 2019, в 07:43

Поделиться

Для меня решением было удаление папки node-sass в C:Users [пользователь]AppDataRoamingnpm-cache

Mosta
18 дек. 2018, в 17:52

Поделиться

При поиске решения проверили версии release узла-узла и обнаружили, что » https://github.com/sass/node-sass/releases » файл узла, который он просматривал, зафиксирован в последней версии, а не в более старая версия. После загрузки необходимого файла » win32-x64-64_binding.node » вручную из выпущенной версии и размещения его в папке C:UsersAdministratorAppDataRoamingnpm-cachenode-sass4.7.2 или просто с помощью npm install node-sass @latest работает для меня.

Mayank Nimje
12 июнь 2018, в 18:29

Поделиться

Зависит от того, какую версию узла вы используете. В настоящее время Node-Sass поддерживает только эти версии:

Поддерживаемые версии Node.js 0.10, 0.12, 1, 2, 3, 4, 5, 6 и 7.

Если вы работаете с одной из этих версий, попробуйте указать, какую версию node-sass вы хотите:

$ npm install --save-dev [email protected]

ваш npm пытается загрузить версию node-sass 3.31.1 версии 3.31.1 которая отсутствует на странице выпусков https://github.com/sass/node-sass/releases

Bamieh
25 авг. 2017, в 09:07

Поделиться

Ещё вопросы

  • 0Управление одним из значений вектора пар в C ++
  • 1ElasticSearch Percolator API с запросами, которые выполняются к дочерним документам
  • 0пытаясь получить данные между кварталом и годом
  • 0Столбцы суммы MySQL из двух запросов
  • 0PHP: несколько файлов загружаются в случайном порядке
  • 0Почему мне нужно обещание обратного вызова из запроса $ ресурса
  • 0Дата DatePicker не устанавливается с помощью кода JQuery
  • 0angularJS Сброс значений $ Scope при нажатии кнопки
  • 0Как братьев и сестер я могу удалить элементы, которые делают?
  • 0Лучший вариант? Действия запроса MySQL
  • 1tf.boolean_mask (2D, 2D) дает 1D результат
  • 1DropDownList в MVC5
  • 1Как сделать всплывающую GUITexture?
  • 0Symfony2 встроенная форма отношения OneToMany, как сохранить связанные данные
  • 1Одновременно суммируйте два ключа в списке диктов по нескольким предметам
  • 0Как связать php и MS SQL в LAMP
  • 1Разница между явным делегатом и группой методов в конструкторе потоков
  • 0Как переименовать файл при использовании move_uploaded_file ()?
  • 1Как я могу установить размер окна Excel? [Дубликат]
  • 0Создание проекта Symfony
  • 1Затмение андроида устройства исчезают
  • 1Установка Android на Windows
  • 0Файловый ввод / вывод не читается ни в чем
  • 0Использование мобильных служб Azure в приложении C ++
  • 0Массивы не ведут себя так, как ожидалось в Tic Tac Toe?
  • 1Android и область использования
  • 1Включите поле, если установлен один из трех флажков C #
  • 1Android: разница между getMainLooper () и Looper.myLooper ()
  • 0Передача входных данных между текстовыми полями HTML
  • 1Как сделать HTTP-запрос к API, используя токен для авторизации?
  • 0Где ошибка в этом запросе? (sql-ex.ru упражнение 25)
  • 0отображение объекта JSON в отдельные элементы div
  • 0PayPal метод DoDirectPayment выдает ошибку
  • 0Получить данные с утра вечера в MySQL
  • 0AscW эквивалент из VB в C ++
  • 0rror: [$ parse: синтаксис] Синтаксическая ошибка: токен ‘,’ является неожиданным токеном в столбце 84 выражения
  • 0Событие выпадающего списка JQuery UI при очистке
  • 0OpenCV случайный лес CvRTrees ошибка
  • 1Проверка прослушивателя работает или нет
  • 0Метеор: Как мне заставить dburles: помощники по сбору работать с Angular?
  • 0JQuery DataTable fnUpdate не обновляет значения из источника объекта: Uncaught TypeError: Невозможно вызвать метод ‘fnSetData’ из неопределенного
  • 0Angularjs и жасмин, тестирование обещают
  • 0oci: использование массива вместо нескольких oci_bind_by_name
  • 0поймать ошибки / прочитать код состояния из вызова покоя — угловой
  • 1Чтобы проверить определенный формат в текстовом поле
  • 1Эффективная очередь с привязкой по времени в Python?
  • 1Обрабатывать несколько событий с помощью одного и того же обработчика
  • 1Проблемы с Java при импорте кода в Eclipse
  • 1Извлечение данных из дерева
  • 0JQuery выбрать все элементы с одинаковым именем класса

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

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

  • Node sass gyp error
  • Node pre gyp err build error
  • Node mysql error connect etimedout
  • Node must be provided when reporting error if location is not provided
  • Node js обработка ошибок

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

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