Cannot find module node-sass while running Ionic 4 - node.js

I have a big problem with node-sass. I have installed Ionic 4 and did my 'ionic serve' but the compile process failed.
I got the following issue:
"Module build failed: Error: Cannot find module 'node-sass'"
I tried a lot, but it is not possible for me to install the node-sass folder under my node_module. I found a notice with a node-sass bug [here]. But nothing works for me. I tried to uninstall node-sass, but this failed too.
I had the same bug with my every Ionic Project Start. I had this at Ionic V3 too. But know its not possible to get this bug fixed.
Hope someone could help me.

I am also facing Cannot find module 'node-sass'" problem. i will use npm rebuild node-sass --force to install node-sass forcefully to my project. And also what i found it node-sass required python to build their library. i installed Python in my C:/ location to fix rebuild fail problem.

Related

create-react-app command aborting installation Why?

windows 10
node v10.15.1
npm v6.8.0;
I:\>npx create-react-app newpomodoro
Creating a new React app in I:\newpomodoro.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...
npm ERR! Unexpected end of JSON input while parsing near '...:"^2.2.x","topo":"1.x'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Administrator\AppData\Roaming\npm-cache_logs\2019-03-03T17_21_57_703Z-debug.log
Aborting installation.
npm install --save --save-exact --loglevel error react react-dom react-scripts has failed.
Deleting generated file... package.json
Deleting newpomodoro/ from I:\
Done.
I installed react globaly and loacaly as well but still it was giving me same error.
Can anyBody tell me whats going wrong.
Use this command:
npm cache clean --force
I am having this same problem with npm install --save --save-exact --loglevel error react react-dom react-scripts has failed. Mine then deletes node_modules and package.json. I have asked about this here: NPX create-react-app aborting installation after vulnerabilities found
I have already tried to use npm cache clean --force but this has not solved the problem. I have also tried installing different versions of node.js to no avail.
I ran into a similar issue. I don't know if you might have been in the same boat, but the cause was a space in my path name. I often save my projects on google file stream which has a space in the name ("G:/My Drive/..."). I tried creating the app in another directory and moving the folder which ended up working out.
The command npm clean --cache won't help.
If you are facing an abort installation error in react.
The abort installation error generated because of the older node version.
you should update your node package version.
To solve, run the following command and it will solve the abort installation error.
nvm install node 12.18.0
So, update your node package to the latest one. Once you've updated your node package then create your react app as follows:
npx create-react-app <your-app-name>
The abort installation error occurred because the outdated version of your node was not supporting the create-react-app command and deleted the node_modules and package.json file
Try this, please. It solved my error and hopefully, it'll solve your error too.
The issue was in node version just update it to latest version and it work's for me!
https://nodejs.org/en/download/
here is the solution which works for me, first of all, you should update all of your dependencies
then ran the command
npm cache clean --force
after that you can use
npx create-react-app

Could not find module 'json-schema' while installing angular cli using npm

I am getting this error:
I am not able to install the angular cli using npm. I am getting the "cannot find module 'json-schema'" error. I tried reinstalling the node js and npm with the latest versions. But the error didn't resolve. Please help me with this.
This issue has a fix in the link below:
https://github.com/kriszyp/json-schema/issues/29
Good Luck
I uninstalled and installed node/npm/angular-cli many times. Finally did a "where ng" on my windows pc, and found the executable was under the %appdata%\npm directory. So after uninstalling node, deleting the %appdata%\npm directory, reinstalling node, and 'npm install -g angular-cli', the ng new and ng serve commands started working.

Can't install firebase-admin with npm

I'm trying to run this command to install firebase-admin: npm install firebase-admin --save
When I try to run this command, I get the following error:
ENOENT: no such file or directory, rename 'D:\MyPath\functions\node_modules\firebase-admin\node_modules\grpc\node_modules\abbrev' -> 'D:\MyPath\functions\node_modules\firebase-admin\node_modules\grpc\node_modules\.abbrev.DELETE'
I have tried reinstalling Node.js, I have tried uninstalling a previous version of Node.js, I have tried updating npm, I have tried pretty much everything online but nothing is helping. If I run the newest version of Node.js, instead of getting this error, I get the following error:
Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` failed with exit code: 1
I have honestly tried several GitHub threads for people with the same problem but none of their solutions have worked for me, so I am trying here. Can anybody help me with this issue?
Upon further tinkering with this, it looks like I finally solved my issue so i can finally deploy to Firebase. These are the steps I took to solve this problem:
First, I uninstalled firebase-admin using the npm uninstall firebase-admin command.
I reinstalled firebase-adming using the npm install firebase-admin command. This didn't seem to fix my issue, but you never know.
I deleted the firebase-admin directory in the node_modules directory.
I ran npm install
I installed the firebase-admin directory again, this time using npm install firebase-admin --save
I ran firebase deploy and it worked!
I don't know how many of those steps were truly necessary but in the end, it worked.
Try to install it using yarn it will get installed smoothly as I faced the same issue while using npm I ran
yarn add firebase-admin and it got easily installed

Gulp installation: 'fs: re-evaluating native module sources is not supported' and node-sass errors

I have a new laptop and have had to reinstall gulp / npm in order to get my website files running properly locally. However I get the following error when I run the gulp command in Windows.
'fs: re-evaluating native module sources is not supported. If you
are using graceful-fs module please update it to a more recent
version'.
After looking into this error I have seen posts saying I simply need to run npm update -g npm. This command runs and flashes some info but then disappears before I can read the message. I assume it is already up to date seeing as though I have just installed it! I have tried running this command both globally and within the project folder.
If I run, npm info graceful-fs -v, my graceful-fs version is 3.10.8
So can anyone help? Im rubbish with this stuff :(
******UPDATE*******
I decided to uninstall graceful-fs and then run npm install.
After running gulp again I get,
Error the 'libsass' biding was not found in...
So I then ran npm rebuild node-sass and get load of node-sass errors.
Please help.
The issue seems to be that gulp 3.x (through vinyl-fs) uses the older version of graceful-fs. See this link for more info. I'm not sure but can you try updating gulp to 4.x ?

Unable to install Cordova with npm

Installing Cordova with Nodejs, i got this error :
npm WARN installMany normalize-package-data was bundled with npm#1.3.4, but bund
led package wasn't found in unpacked tree.
The error comes after the command npm install -g cordova
What can be the solution please ?
Thnx
I have solved this issue, so i present here what i did to solve it for anyone who may have the same problem :
I thought about reinstalling Nodejs. So i removed it and installed it again but nothing worked, then i took an installation directory of Nodejs in another computer (which works fine) and copied it to my computer and referenced it in the path environnement variable and every thing worked fine !!
The problem is with cordova and the version of the node.js. The latest version for Node.js (as of today for windows) is problematic with cordova. I went back a few versions and Node-v0-10-36-stable is working fine so far. Other versions may also work but I can only speak for v0.10.36.
http://blog.nodejs.org/2015/01/26/node-v0-10-36-stable/

Resources