Bower "MODULE_NOT_FOUND Cannot find module 'qs'" - node.js

No matter what I do, I keep getting the message:
bower MODULE_NOT_FOUND Cannot find module 'qs'
Whenever I try to install a package with bower.
NPM version 1.4.14
Bower version 1.3.8
Node Version 0.10.29
Anyone have any idea what I can do to fix? I'm running out of ideas at this point, I've tried reinstalling node, downgrading NPM (from 1.5.0 Beta 3).

I solve this by reinstalling bower by npm.
npm install bower -g

Try setting the NODE_PATH environment variable. This is needed when you install modules in a local context.
export NODE_PATH=${PWD}/node_modules
http://nodejs.org/api/modules.html#modules_loading_from_the_global_folders

Related

Npm -v error: cannot find module 'are-we-there-yet'

I recently upgraded nodejs from v6.9.2 to V10.16.3. But after the upgrade I am not able to do npm install.
npm -v gives the following error -
Error: cannot find module 'are-we-there-yet'
I have tried uninstalling nodejs and reinstalled it. But still getting the same error.
Any solution would be really helpful.
Hm, pretty strange error, try to install it globally with npm i are-we-there-yet -g
You have broken npm by removing some of its dependencies. are-we-there-yet is a dependency of npmlog which is a dependency of npm itself, and you somehow deleted it.
So you have to reinstall the node from scratch - https://docs.npmjs.com/downloading-and-installing-node-js-and-npm

Error on installing angular/cli - not found: python2

I am trying to install with this command "npm install -g #angular/cli".
But I always get the error "Error: not found: python2"
Is there something I am missing here?
Just in case you do not want to downgrade, which is not needed anyways.
Then this is what you should do,
Fix node-sass version issue first:
The issue is with the version of node-sass (prior to the python2 error). So install it as
npm install node-sass.
Now run npm install
If it asks to fix using npm audit fix. Go ahead!
Downgrade to npm version 4, try this:
npm install -g npm#4.6.1
I had the same issue. I manage to install the python 2 version. It got solved this is the version i installed
https://www.python.org/ftp/python/2.7.15/python-2.7.15.amd64.msi

Npm install does not work

I have a problem with my npm. This is my error:
I try to uninstall nodejs and install it but my error stays, then I try the command npm install npm, Have the same error and npm -v does not work too.
Try to delete %APPDATA%\npm and reinstall node.
package semver is missing.
running npm install semver and try again

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

bower installed but doesn't install package

I am looking to use yeoman with the generator-marionette.
I am on debian 7
I have installed nodejs v0.10.28 and npm 1.4.9. and
grunt-cli (global)
then i installed bower : npm install -g bower
bower help works fine
bower install gives Nothing (no packages installation, no error message) (bower.json exists)
bower install jquery gives the same result.
Does someone has an idea of what appends and a solution to solve this problem ?

Resources