Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

npm install ->Failed at the [email protected] postinstall script

I'm trying to do npm install and an error appears :

Failed at the [email protected] postinstall script.

I tried to delete node_modules and then reinstall it, same error appears. what will be the solution?

node v8.9.3
npm v5.4.2
ionic 3.19.0

like image 848
Joe Sleiman Avatar asked Jan 17 '18 10:01

Joe Sleiman


6 Answers

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

  • Delete package-lock.json,
  • Delete node_modules folder,
  • Run npm install again.
like image 128
Michaël Polla Avatar answered Oct 11 '22 01:10

Michaël Polla


try

sudo rm -rf package-lock.json node_modules
sudo npm cache clean --force
npm i --unsafe-perm node-sass
like image 29
Jaisa Ram Avatar answered Oct 11 '22 00:10

Jaisa Ram


Just Try with this command hope it will very helpful. it's working for me

sudo npm install -g [email protected] --unsafe-perm=true --allow-root
like image 44
Abhay Singh Avatar answered Oct 11 '22 01:10

Abhay Singh


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

You can use nvm to do so:

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

> nvm install 10.17.0
> nvm use 10.17.0
> node -v
10.17.0
like image 24
Microsmsm Avatar answered Oct 10 '22 23:10

Microsmsm


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

  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. Delete package-lock.json file and node_modules folder from your project.

  3. Force clean the entire NPM cache by using following comand.

    npm cache clean --force
    
  4. Re-Install all the dependencies.

    npm install
    
  5. Now you can install node-sass.

    npm i node-sass
    
like image 20
Aravinda Meewalaarachchi Avatar answered Oct 11 '22 00:10

Aravinda Meewalaarachchi


[email protected] cannot be installed on node 8

enter image description here

Please update either node-sass or node version compatible

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

like image 17
aldo Avatar answered Oct 11 '22 01:10

aldo