npm ERR! Failed at the node-sass#4.14.1 postinstall script - node.js

I'm trying to install the following library in my react app: react-awesome-loaders.
However when i try to install it i get this error:
npm ERR! Failed at the node-sass#4.14.1 postinstall script.
my node-sass verison is: 6.0.1
my node version is 15.6
I have removed package-lock.json and node_modules and cleared npm cache, and then installed the packages again but that didn't help.
Any idea what the issue is?

One of your sub-dependencies is trying to install node-sass 4.14.1, which isn't supported by Node 15.
PS: Node 15 is end of life, but you may need to go to Node 14, if you need to install node-sass 4.14.1

Related

Error installing sveltekit app after upgrading Node to latest version

I recently upgraded node to the latest version (v16.15.1). After upgrading, I started a new sveltekit site using the following command:
npm init svelte my-app
I CD'd into my-app and ran npm install and get the following error:
npm ERR! code 127
npm ERR! path /Users/henken/Sites/my-app
npm ERR! command failed
npm ERR! command sh -c svelte-kit sync
npm ERR! sh: svelte-kit: command not found
I've created many sveltekit apps using these exact steps without any issues until today after upgrading node. Any suggestions would be much appreciated.
Remove the my-app folder and run:
npm init svelte#latest my-app
The #latest makes sure that npm uses latest version of the create-svelte package.
The version you've got cached locally could be incompatible with the current version of SvelteKit.
Alternative things to try:
Reboot PC (removes environment settings that could point to previous node installation)
Upgrade npm to latest version

I cannot run npm install

I've dual Boot(ubuntu/Windows 10) on my laptop.
I am getting this error and I can't run npm install on Ubuntu. I checked with node -v and it shows v17.4.0
:
npm does not support Node.js v13.14.0
npm ERR! Invalid or unexpected token
npm ERR! A complete log of this run can be found in:
npm ERR! /home/diana/.npm/_logs/2022-02-12T09_42_18_704Z-debug-0.log
Update: I had to uninstall and remove all the folders related to node and npm. I've also installed the latest version of nvm 0.39 and only then I managed to actually upgrade the node to the right version. Everything is working now.
How can I completely uninstall nodejs, npm and node in Ubuntu
Have you tried updating your npm?
If no, run this:
sudo apt-get install -y npm
or check this:
https://stackoverflow.com/questions/23393707/how-to-update-npm#:~:text=sudo%20add%2Dapt%2Drepository%20ppa%3Achris%2Dlea/node.js%0Asudo%20apt%2Dget%20update%0Asudo%20apt%2Dget%20install%20nodejs%20npm

npm ERR! cb.apply is not a function (Elementary OS)

I am very new to react native and nodejs . Today I installed nodejs on my Elementary Os and installed npm and npx. Now when I try to run npx create-react-app myApp i am getting the following error :
npm ERR! cb.apply is not a function npm ERR! A complete log of this
run can be found in: npm ERR!
/home/user/.npm/_logs/2021-04-29T08_55_29_599Z-debug.log Install for [
'create-react-project#latest' ] failed with code 1
I found some answers on stack overflow but they didn't solve this. Any help would be much appreciated.
npx version:10.2.2
npm version: 7.10.0
node version :16.0.0
I finally solved the error and i am going to keep this thread open if anyone else faces the same problem.
By default, npm installs packages in the local node_modules/ directory. Since npm i npm is shorthand for npm install npm, it will install the latest version of npm locally.
However, when run npm in a shell, the shell picks up the npm in your $PATH, which is probably the global installation.
To update the global installation of npm, run:
npm install --global npm

Why does the newest Angular CLI have a corrupted packages?

I installed the latest Node and Angular on Windows 10
npm install npm#latest -g
npm install -g #angular/cli#latest
But when I try to start a project ng new new-project I get the following error
npm WARN tarball tarball data for #angular/compiler#^6.1.0 (sha512-TY6axB1c7VvYXf+ebFDq3Ej+edgii3CDxew8HnyTFAWeDF2Gh8io1vTYwtdyDka6U53ASaheM1HpiUjzvYH0jQ==) seems to be corrupted. Trying one more time.
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\admin\Desktop\...\node_modules\.staging\#angular\common-6be83a81\locales\si.js'
...
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\admin\AppData\Roaming\npm-cache\_logs\2018-10-08T01_01_48_404Z-debug.log
Package install failed, see above.
I tried to uninstall Node.js and Angular CLI completely and then reinstall again
npm install npm#latest -g
npm install -g #angular/cli#latest
But still the same error ..... So I googled this issue. It seems like some people had it too, but then it magically disappeared for some people.
How to fix this?
I was getting the same below error when attempting to a create new project using ng new command.
npm WARN tarball tarball data for #angular/compiler#~7.2.0
(sha512-5yb4NcLk8GuXkYf7Dcor4XkGueYp4dgihzDmMjYDUrV0NPhubKlr+SwGtLOtzgRBWJ1I2bO0S3zwa0q0OgIPOw==)
seems to be corrupted. Trying one more time.
I tried many things but what did not worked and what finally worked for me I have listed below. My working node version is 12.2.0 and npm version is 6.9.0 (i.e. latest version).
What did not worked:
Downgraded node js to other lower versions (tried many version)
Deleted package-lock.json file from project and executed npm install
Executed npm install --registry https://registry.cnpmjs.org instead of npm install
Deleted npm and npm-cache folders from AppData\Roaming and then again installed node js
Deleted node_modules folder, executed npm update and then executed npm install
Executed npm cache clean --force and then executed npm install
Reinstalled #angular/cli
Checked for any firewall / antivirus (in my case it was disabled)
Opened node command prompt as an administrator
Checked user permissions for the project folder
Finally what worked is:
Installed the component for which it was giving error. npm install -global #angular/compiler
I had the same problem with node 12.13.0 and npm 6.13.0
npm WARN tarball tarball data for #angular/compiler#^7.2.11 (sha512-5yb4NcLk8GuXkYf7Dcor4XkGueYp4dgihzDmMjYDUrV0NPhubKlr+SwGtLOtzgRBWJ1I2bO0S3zwa0q0OgIPOw==) seems to be corrupted. Trying one more time.
For me the problem was npm. After upgrading npm to the newest version with npm i -g npm#latest the problem vanished. So it seems to be a problem with npm itself and not the Angular/CLI.
upgrade your NPM version use this command i -g npm#latest it works like magic

Local grunt installation gives error

npm install -g grunt-cli //done successfully
npm install grunt --save --only=dev
gives following error
(node:11000) fs: re-evaluating native module sources is not supported. If
you are using the graceful
-fs module, please update it to a more recent version.
npm WARN prefer global coffee-script#1.10.0 should be installed with -g
project#1.0.0 C:\Users\Live\Desktop\node grunt\final
`-- (empty)
npm WARN project#1.0.0 No repository field.
npm ERR! code 1
Tried uninstalling grunt-cli, cleaning npm cache, then re-installing, but still the problem persists.
Ok short recap:
When in doubt remove your node_modules and install all packages again using npm install
If that didn't work, try updating your npm by executing npm update -g npm and redo step 1.
If that didn't solve your problem, try upgrading to another NodeJS version using nvm or n.

Resources