Cannot install node-sass - node-sass

I'm in an environment where I am required to run a local proxy, and I am unable to install node-sass. When I try the following:
npm install -g node-sass
I get an error:
Cannot download "https://github.com/sass/node-sass/releases/download/v4.5.3/win32-x64-48_binding.node": tunneling socket could not be established, cause=read ECONNRESET
I have already installed cntlm and configured it correctly. To verify I use the porxy server to access internet and it works fine.
The following environment variables are set
http_proxy -> http://localhost:3128
https_proxy -> http://localhost:3128
Have also added the following to my .npmrc
https-proxy=http://localhost:3128
http-proxy=http://localhost:3128
proxy=http://localhost:3128
Also tried by adding slashes to the end but the result is the same.
Any clues and help would be appreciated since I have no idea how to resolve this.
Additional details:
node -v
v6.11.4
npm -v
5.5.1

The workaround I found was to download the node-sass file from https://github.com/sass/node-sass/releases/download/v4.5.3/win32-x64-48_binding.node and then set the sass-path to the binaries downloaded:
SET_SASS_BINARY_PATH = C:\..\..\
and then doing
npm install -g node-sass
worked for me.

Related

I can’t show the version of an NPM package (nodemon --version), what to do?

I tried to run codes in my hyper-terminal (deleted nodemon and then reinstalled it) but at the end I still can NOT get the version of my nodemon, it says:
"C:\Users\azadk\AppData\Roaming\npm/node_modules/node/bin/node: line 1: This: command not found"
Here’s what I tried to do:
I also tried to set the path of Environment variables to "C:\Program Files\nodejs" but still I can’t get the version.
If you are connected to some sort of VPN or your corporate internet, try to connect to another network and run the call again.
I entered these commands and the problem was resolved:
npm config rm proxy
npm config rm https-proxy
npm config delete http-proxy
npm config delete https-proxy
set HTTP_PROXY=null
set HTTPS_PROXY=null

NPM cannot find nodejs

Every time I try to install something with npm or do npm install or anything else with npm, I get this: env: node: No such file or directory. Is there anything I can do about it? (i tried reinstalling it with homebrew and node.js's website)
Install node.js again as node -v or npm -v isn't working for you. Seems problem with node installation itself. You can download and install from https://nodejs.org/en/download/.

Cannot get "npm install #feathers/cli -g" to work in the command line

I get this error message when I try installing feathers from npm
npm WARN deprecated nomnom#1.8.1: Package no longer supported. Contact support#npmjs.com for more info.
npm WARN deprecated babel-preset-es2015#6.24.1: 🙌 Thanks for using Babel: we recommend using babel-preset-env now: please read babeljs.io/env to update!
Help!!
As Vasan pointed out in the comments, running
npm install -g #feathersjs/cli
from the command prompt on Windows installs a file feathers.cmd in the folder:
%APPDATA%\npm
If this folder is not on your PATH, then feathers will not be recognised as an executable - it appears that the global install doesn't add it to the path automatically.
Editing system environment variables to add this folder to your path should make the feathers cli tools available.
Note that after altering your path you may need to restart your terminal for the updated path to be available.
Its very simple, if you have an earlier version installed, uninstall the old feathers-cli using:
npm uninstall feathers-cli -g
Then install #feathersjs/cli and upgrade a project by the following commands:
npm install #feathersjs/cli -g
cd path/to/project
feathers upgrade
I also faced with the installation issue. But got an error: 404 Not Found: babel-messages#^6.23.0. I've solved it when run npm install #feathersjs/cli -g through the windows terminal (cmd). Before that I was running it on bash.
This issue also occurs when installation is ran using Admin credential(Windows 10), reinstall without elevated cmd/powershell credential also solved the problem.

access npm modules locally in case npm server is down

I am looking to store npm modules in a cache/locally in case the npm server is down and I cannot access the modules.
I hear npm-cache or npm-offline work well, but I'm not sure if they actually solve the problem I face - which is accessing an npm module locally.
Any recommendations?
Install offline-npm with
sudo npm install -g offline-npm
offline-npm will run a local http server with the content of your cache. Launch the server with:
offline-npm -n -d
You can then install packages from your cache with:
npm --registry http://localhost:4873 install <packagename>
To inspect the content of your cache run:
npm cache ls
You can also add a package to your cache without installing it with:
npm cache add <package>
For more information, read the official documentation of offline-npm.

Cannot install phantomJS in Karma

WARN [config]: config.configure() is deprecated, please use config.set() instead.
WARN [plugin]: Cannot find plugin "karma-phantomjs".
Did you forget to install it ?
npm install karma-phantomjs --save-dev
INFO [karma]: Karma v0.10.2 server started at http://localhost:9018/
WARN [launcher]: Can not load "PhantomJS", it is not registered!
Perhaps you are missing some plugin?
Getting this error. When running npm install karma-phantomjs --save-dev I get an error.
npm ERR! 404 'karma-phantomjs' is not in the npm registry.
I installed karma-phantomjs-launcher --save-dev but i still get an error when running grunt watch.
Anyone else run into this issue?
npm install karma-jasmine --save-dev
npm install karma-phantomjs-launcher --save-dev
Then add the following line to karma.config.js
plugins : ['karma-jasmine', 'karma-phantomjs-launcher']
I got tripped up by this today running
karma: 0.13.7
karma-phantomjs-launcher: 1.0.0
What isn't very obvious is that the launcher has a dependency on:
phantomjs-prebuilt
So if you, install this locally everything should run fine, eg:
npm install phantomjs-prebuilt --save-dev
After some research I realized that I needed to run:
npm install -g karma#canary phantomjs karma-phantomjs-launcher
Once I ran that I went back into my karma-unit.tpl.js file and instead of karma-phantomjs, I changed this to karma-phantomjs-launcher.
Now when I execute a command like grunt build, I get no error regarding phantomJS
This is an issue still open on the repo: #31
Strangely enough the following worked for my Debian based system:
apt-get install libfontconfig
How did I get into this? Reading a comment from the ticket. Hope this will help for others too :-)
I'm running in a CentOS 7 Docker container. Had similar issue.
Had to:
yum install -y tar bzip2 freetype fontconfig
Then
npm install phantomjs --save-dev
worked without errors, which allowed
npm install karma-phantomjs-launcher --save-dev
and that allowed
gulp test
to run without Karma or PhantomJS errors.
Today I had the same. I deleted all the temporary directories and, after rerun it worked.
Before that i also reinstalled phantomjs but without success. It's possible that this influenced, anyway (but i think deleting the temporary directories did the job). Anyway, after deleting temporary folders you can try, if it didn't work you can reinstall phantomjs and also other stuff as other users already wrote.