Cannot find module 'har-schema' - node.js

I am trying to make ionic2 app. But npm is not supporting. It always gives me this error.

Try to install previous version of npm:
npm install npm#5.2 -g
Unfortunatelly, current version(5.3) has a lot of bugs.

I found solution of it. Solution is uninstall node and npm completely from your PC and then re-install it.
to uninstall node and npm completely check this link.
How to completely remove node.js from Windows

This worked for me:
npm install -g --only=production --save har-schema

Related

Installing lodash.filter

What is the difference between npm install and npm install --save?
I try to install lodash.filter using npm install --save lodash.filter. I thought it install the packet + describes it in package.json.
But the system says, she do not understand, what lodash.filter is.
Should I install lodash.filter again using npm install lodash.filter? Or what should I do? Uninstalling lodash.filter and trying to install it again?
To check installed modules use npm ls to show all your modules and npm ls lodash.filter to see, if it is installed. I think the system showed the mistake, because imported lodash.filter wasn't used in program (I followed the other steps in the tutorial and it rendered well).

error when trying ''npm install node-sass --save dev"

PLEASE HELP!
Just a noob here, I am trying to work with some npm packages like sass, and I get this strange error mentioning LINUX OS, which was just tried to install on my computer.
How to fix this? Just to continue with my work, please.
Thanks in advance!
npm install node-sass --save-dev
Parameter --save-dev instead of --save dev ,You can run npm --help to see more details.
According to node-sass package docs there are prerequisites for windows:
https://www.npmjs.com/package/node-sass
You can find the node-gyp install details here:
https://github.com/nodejs/node-gyp#on-windows
If you are trying to install sass while your server is still running and getting this error, you can try restarting your server.
Try this
npm install -g node-sass

Installing of Angular is not successful. No errors shown

If you look a the picture I made sure I had npm and node and then tried to install Angular CLI and it does not give me an error or anything. I am not sure what I have done. This laptop did crash a while back and I reloaded it not sure if that would contribute to this issue.
I even updated npm and node to the latest to see if that would fix the issue. I am on Windows 10 Home edition. The angular CLI seems to be working on my home desktop. How can I get this working again even if I uninstall something to get it working correctly.
I thought it was NPM but somehow I have the loglevel set to silent.
Try installing it globally,
npm install -g #angular/cli
Give an uninstall a try.
npm uninstall -g #angular/cli
npm cache clean
npm install -g #angular/cli#latest
In the screenshot you posted, there is this line
npm ERR! npm -v 1.3.21
Maybe you should reinstall node also.
I finally uninstalled NODE completely and found the extra folders left over and reinstalled and that has fixed my issue. Nothing to do with Angular. Thanks for helping.
Try this:
npm install angular-cli

Unable to npm install or start with electron-quick-start

I am using the version of node that is stated on electron's site, which is 7.4.0 and I'm using NPM version 4.0.5 (Windows).
The problem I'm having is with the npm install command in the cloned electron-quick-start folder. I have tried using the command with --save-devand -g but they don't do anything to help.
Upon using just npm install;
fetchMetadeta: still install loadAllDepsIntoIdealTree
With the above stated arguments (output);
--electron-quick-start#1.0.0
Then npm start after the above output;
Pastebin
Any help would be greatly appreciated, thanks.
You must get npm install to work before you can start the app
You could try the following
npm cache clean
npm install This will cache clean of npm
npm install -g yarn
yarn install This will install yarn (This will probably work but it might not be what you're looking for). Yarn is an alternative to npm
npm -g install npm
npm install This will reinstall npm
And I would look into nvm and nvm-windows
And if none of those work I would look at
this issuse on github
And if that doesn't work I would just look at google

libsass bindings not found when using node-sass in nodejs

I want to use the node-sass module in my node.js v0.12 application to benefit from the performance of libsass.
I executed npm i node-sass to install the module, no errors so far.
Now the mess starts:
If I just open the REPL in a terminal to try out node-sass then everything works fine but if I include it in my project files and run node myfile.js then I get the following error message:
Error: `libsass` bindings not found. Try reinstalling `node-sass`?
The module's description at npmjs.com states that there might be a problem with resolving #!/usr/bin/env node under Ubuntu and how to fix this but that is not the case on my machine.
I could not find anything useful so I hope that you might help me.
I'm using node v0.12.2 under Ubuntu 14.10.
P.S.: I already tried to reinstall node-sass but without success. Nothing changes.
If you're using node 4.x or later then you need to reinstall gulp-sass with:
npm uninstall --save-dev gulp-sass
npm install --save-dev gulp-sass#2
You’ve probably tried to reinstall node-sass while using
npm install node-sass
or
npm uninstall node-sass
npm install node-sass
But node-sass is a C version of Sass. You have to use npm rebuild:
npm rebuild node-sass
I fixed this issue by deleting the existing /node_modules folder and running npm update
This is the only solution that worked for me,
sudo npm install -g n
sudo n 0.12.7
npm install node-sass#2
sudo npm -g install node-gyp#3
npm rebuild node-sass
This workaround (http://forum.ionicframework.com/t/error-running-gulp-sass/32311/20) worked form me.
Starting with this setup:
Cordova CLI: 5.3.3
Gulp version: CLI version 3.9.0
Gulp local: Local version 3.9.0
Ionic Version: 1.1.0
Ionic CLI Version: 1.6.5
Ionic App Lib Version: 0.3.9
ios-deploy version: Not installed
ios-sim version: 5.0.1
OS: Mac OS X Yosemite
Node Version: v4.1.1
Xcode version: Xcode 6.4 Build version 6E35b
I've found a solution to avoid to use 'sudo' command. We need before to fix npm permissions following this: https://docs.npmjs.com/getting-started/fixing-npm-permissions and fixing permissions for Node here: http://mawaha.com/permission-fix-node-js/ After this we can check and reinstall software without 'sudo' for npm, n or ionic.
I followed this step:
npm install -g n
rm -R node_modules/
npm install node-sass#3.3.3
npm -g install node-gyp#3
npm uninstall gulp-sass
npm install gulp-sass#2
npm rebuild node-sass
ionic setup sass
Why node-sass#3.3.3? Because it works with latest ionic version: https://github.com/driftyco/ionic/pull/4449
Combining the two answers above worked for me, plus additions:
sudo npm uninstall --save gulp-sass
npm install --save gulp-sass#2
npm update
npm rebuild node-sass
I have solved this to create the right directory with the specified binding.node file. You can download the bindings from github
https://github.com/sass/node-sass-binaries
Look in the error message the path where it tries to find the binding. In my case:
C:\Users\Martijn\Documents\node_modules\gulp-sass\node_modules\node-sass\vendor\win32-x64-46
So I create this map win32-x64-46 and copy the binding from github in.
My solution was to downgrade to v0.10.25 (try sudo n 0.10.25 if you use n)
For me, this issue was caused in my build system (Travis CI) by doing something kind of dumb in my .travis.yml file. In effect, I was calling npm install before nvm use 0.12, and this was causing node-sass to be built for 0.10 instead of 0.12. My solution was simply moving nvm use out of the .travis.yml file’s before_script section to before the npm install command, which was in the before_install section.
This was a Node version issue for me, try using nvm to backtrack your version to something like: 0.10.32. This worked for me. I was running 4.2.2
I solved this problem by updating my gcc from 4.4.x to 4.7.x
No need for sudo or re-installations. This has always worked for me:
nvm use 0.12.2
This is the steps I undertook to fix my issue.
I updated my node manually to the latest version
Reinstalled node-sass
npm install node-sass
3.npm audit fix to fix certain vulnerabilities.
`npm audit fix`
5.npm install node-sass
`npm install node-sass`
worked and compiled properly thereafter.
I apologize if anything related to my answer isn't right. I'm just a beginner.
Hope it works for you

Resources