npm install ->Failed at the node-sass@4.5.0 postinstall script

npm v5.4.2
ionic 3.19.0

You should try to install SASS.

ing except time to try, right ?

171503 次浏览

I remember havign this issue in AngularJS with compass, I had to install it with Ruby to make it work. This was 3 years ago, so I'm not sure this would be the solution, but it doesn't cost anything except time to try, right ?

Uninstall current npm and install lower versions, it is a common error if version didn't match, downgrading node/npm will mostly fix this kind of issues

npm install -g npm@4.6.1

After uninstalling node-sass try cleaning your npm cache. After that try installing node-sass again.

npm cache clean && npm install node-sass

Got the same problem (node v10.3.0, ionic 3.13.0). This worked :

    s folder,
  • Run npm install again.
  • Delete package-lock.json,
  • The minimum version of node-sass that supports Node 8 is 4.5.3. You'll need to upgrade your node-sass or downgrade your Node version. Ionic may also have separate issues since it isn't a tested platform with node-sass.

  • Run npm install again.
  • Node-sass@4.5.0 cannot be installed on node 8

    enter image description here

    10.17.0

    Please update either node-sass or node version compatible

    s://github.com/sass/node-sass/releases" rel="noreferrer">https://github.com/sass/node-sass/releases to check which fits for you

    Just Try with this command hope it will very helpful.

    I needed to take the following steps to "resolve" this problem:

      it's working for me

      sudo npm install -g node-sass@4.5.0 --unsafe-perm=true --allow-root
      
    1. Create folder at the root: mkdir ~/safe_node_module;
    2. ://github.com/sass/node-sass/releases/download/v4.13.0/linux-x64-72_binding.node and then send to the folder created in step 1;
    3. Download package wget -q https://github.com/sass/node-sass/releases/download/v4.13.0/linux-x64-72_binding.node and then send to the folder created in step 1;
    4. Set the export environment variable export SASS_BINARY_PATH=/home/ronaldaraujo/safe_node_module/linux-x64-72_binding.node;
    5. Set the export environment variable export SASS_BINARY_PATH=/home/ronaldaraujo/safe_node_module/linux-x64-72_binding.node;
    6. Install packages normally npm i;
    install

    Sometime unable to download file win32-x64-79_binding.node due to your proxy restrict to download so plase follow this below link set them manually. "https://github.com/sass/node-sass/issues/2773" rel="nofollow noreferrer">https://github.com/sass/node-sass/issues/2773

    I had the same issue with a new install with Keystone.js. I was able to get pass this issue by removing Node Sass from package.json and running npm install again. Being that the package wasn't listed under node modules. And it worked fine after that.

    Solved this by force installing node-sass locally: npm install -f node-sass

    rolling back to node v10.17.0 fixed the problem to me.

    You can use nvm to do so:

    I was pretty sure I knew what I was doing... this

    https://github.com/nvm-sh/nvm

    > nvm install 10.17.0
    > nvm use 10.17.0
    > node -v
    10.17.0
    

    Go to https://github.com/sass/node-sass/releases to check which fits for you

    I also had to face the same problem with node v12.16.3.

      ce clean the entire NPM cache by using following comand.

      npm cache clean --force
      
    1. Remove node-sass dependency from your package.json if it is mentioned in your dependencies.This will allow npm to install other required dependencies without any disruption.

    2. Re-Install all the dependencies.

      npm install
      
    3. Delete package-lock.json file and node_modules folder from your project.

    4. Now you can install node-sass.

      npm i node-sass
      
  • Download package wget -q https://github.com/sass/node-sass/releases/download/v4.13.0/linux-x64-72_binding.node and then send to the folder created in step 1;
  • I'm trying to do npm install in the ionic project and an error appears

  • Set the export environment variable export SASS_BINARY_PATH=/home/ronaldaraujo/safe_node_module/linux-x64-72_binding.node;
  • Failed at the node-sass@4.9.0 postinstall script.

  • Install packages normally npm i;
  • The following steps worked for me ionic project

    Remove npm than run the following commands

    The following steps worked for me

    npm install -g node-sass@4.5.0 --unsafe-perm=true --allow-root
    
    
    npm cache clean
    
    
    
    
    npm install
    

    I was pretty sure I knew what I was doing... this

    This works for me on Windows running Node.js version v14.17.3

    npm install -g node-sass@4.5.0 --unsafe-perm=true --allow-root --force
    
    node-sass version was node-sass@4.13.1. But the above command will work for other versions too. Just replace the node-sass version number in the above command with your required node-sass version.

  • Now you can install node-sass.

    npm i node-sass
    
  • npm i

    npm install @ionic/app-scripts@latest--unsafe-perm=true --allow-root

    code. You can then add to it an env property with a dictionary of string:string.

    Assuming you mean for a debugging session(?) then you can include a env property in your launch configuration.

    Here is an example for an ASP.NET Core app from their standard web template setting the ASPNETCORE_ENVIRONMENT to Development :

    {
    "version": "0.2.0",
    "configurations": [
    {
    "name": ".NET Core Launch (web)",
    "type": "coreclr",
    "request": "launch",
    "preLaunchTask": "build",
    // If you have changed target frameworks, make sure to update the program path.
    "program": "${workspaceFolder}/bin/Debug/netcoreapp2.0/vscode-env.dll",
    "args": [],
    "cwd": "${workspaceFolder}",
    "stopAtEntry": false,
    "internalConsoleOptions": "openOnSessionStart",
    "launchBrowser": {
    "enabled": true,
    "args": "${auto-detect-url}",
    "windows": {
    "command": "cmd.exe",
    "args": "/C start ${auto-detect-url}"
    },
    "osx": {
    "command": "open"
    },
    "linux": {
    "command": "xdg-open"
    }
    },
    "env": {
    "ASPNETCORE_ENVIRONMENT": "Development"
    },
    "sourceFileMap": {
    "/Views": "${workspaceFolder}/Views"
    }
    },
    {
    "name": ".NET Core Attach",
    "type": "coreclr",
    "request": "attach",
    "processId": "${command:pickProcess}"
    }
    ]
    }
    
    
    

    Install the higher version of node-sass

    npm install node-sass@4.13.1
    
    d show up in your global variables. That module is here.

    If you've already assigned the variables using the npm module dotenv, then they should show up in your global variables. That module is here.

    While running the debugger, go to your variables tab (right click to reopen if not visible) and then open "global" and then "process." There should then be an env section...

    enter image description here

    enter image description here

    enter image description here

    Note: My node-sass version was node-sass@4.13.1. But the above command will work for other versions too. Just replace the node-sass version number in the above command with your required node-sass version.