I am accessing internet under the wifi network(cyberoam) provided by our college. Whenever I am trying to install any npm package I am getting error like:
npm ERR! If you are behind a proxy, please make sure that the
npm ERR! 'proxy' config is set properly. See: 'npm help config'
ECONNREFUSED
I haven't set up any proxies on my Linux machine then also I'm getting error like this.
Is there any way to install those packages locally i.e how can I use them directly without installing them as npm packages.
Yes it is possible but I usually don't do that. For a quick and dirty solution:
Search for the packages repos in github
Checkout them to your local machine
And copy each one to the ./node_modules directory inside your node.js application folder.
In the future I certainly recommend you to use npm instead.
Related
I am trying to setup a simple node app in docker. The app needs to install npm package ibm_db. In that installation of ibm_db, node-gyp wants to download headers file from the internet which is not allowed under company firewall rule. Downloading npm packages works fine using a proxy.
https://nodejs.org/download/release/v16.14.2/node-v16.14.2-headers.tar.gz failed, reason: unable to get local issuer certificate
I am unsure of the best way forward here. Is it possible to install the headers.tar manually somehow?
Commit the specific version of the node-{NODE_VERSION}-headers.tar.gz file that you require into the repo, and do this:
echo "---> Set tarball"
NODE_VER=v16.13.1
npm config set tarball /{YOUR_PATH}/node-${NODE_VER}-headers.tar.gz
Then proceed with your npm install as you would normally.
https://github.com/nodejs/help/issues/3686#issuecomment-1011865975
I was trying to run npm install inside the project folder but every time there is this error showing npm cb() never called.
I am using node version 10.16.2 and npm version 6.9.0 in windows 10
I have tried npm cache clean --force but that didn't help
E:\contribution\contribute-to-open-source>npm install
npm ERR! cb() never called!
npm ERR! This is an error with npm itself. Please report this error at:
npm ERR! <https://npm.community>
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\papun\AppData\Roaming\npm-cache\_logs\2019-08-10T03_51_20_512Z-debug.log
I had the same problems and lost hours trying to solve it :(.
But then i found out that my firm has installed some new kind of firewall with self signed certificate.
Quick solution was:
npm config set strict-ssl=false
After that everything started working without 'npm cb() never called' errors
I had faced the same issue, and i spend days to get a solution for the issue. In the end, i figured it out and it was an issue with my network.
Please verify your network connection and proxy settings.
In my case, I was using corporate proxy using a script. When i opened the pac file and get the proxy from there ( take XXX:XXX from the line return "PROXY XXX:XXX;";) and added to npm config proxy setting (npm config set proxy XXX:XXX), it started working and got resolved.
run this all issue will be solved..
npm install --global windows-build-tools
try to set your proxy using the commands
npm config set proxy http://proxy_host:port
npm config set https-proxy https://proxy_host:port
I have deleted all the node_modules, package-lock.json but still it was not working. For me the reason was, there were some modules that required relogin to install.
So, I deleted my node_modules, build and package-lock.json. and opened command prompt in admin mode.
Then went to the specific project path and logged-in to the components that require credentials.
1. npm login (root path of your react app)
2. type username as "<xxxxx>"
3. type password as "<yyyyy>" (won't be visible on console)
4. type email as "<zzzz>#<aaa>.com"
5. npm i
6. npm run build
It worked for me.
I also faced the same problem I deleted that file from
C:\Users\Harshk1311\AppData\Roaming\npm-cache\_logs
And problem solved
Double Check file name in terminal where error occured and delete file
i.e C:\Users\Harshk1311\AppData\Roaming\npm-cache_logs\2019-08-10T03_51_20_512Z-debug.log
Delete 2019-08-10T03_51_20_512Z-debug.log only this file .
Another possible reason that solved the problem in my case:
Missing MS VC Redistributable. For example if you are on a fresh new PC. In this case you could download the e.g. VC_redist.x64.exe and install it. You may need to restart the terminal before e.g. executing npm i again.
The Visual C++ Redistributable installs Microsoft C and C++ (MSVC) runtime libraries. These libraries are required by many applications built by using Microsoft C and C++ tools.
I need to install Socket.io on a machine without internet access.
I've downloaded Node.js and Socket.IO on another box, but when I copy and try to install them on the isolated machine, Node.js installs ok, but Socket.IO insists on connect to GitHub.
How can I install Socket.IO without an internet connection? Should I install all dependencies offline? If so, what are the dependencies of Socket.IO?
It turns out that npm supports package caching. Basically you create a cache on the development machine that does have internet access, copy that cache onto your target at the same time that you install your nodejs application, and then install the packages from the cache. I assume from your question that the target machine already has nodejs and npm installed.
Step 1. Use npm to create a cache directory on your development machine
First, create a cache directory and configure npm to use it. Then install each of your packages.
mkdir ../my-cache
npm config set cache ../my-cache
npm install --save async#0.9.0
npm install --save restify#2.8.3
etc.
If you look in the my-cache directory you'll see sub-directories for each installed package.
Step 2. Copy the cache to your target machine along with your node application
No rocket science here: make sure you copy the my-cache directory to your target machine.
Step 3. Use npm to install the packages from the cache
Configure npm to use the cache directory. Be aware that npm will still try to go fetch the package files form the internet. And it will retry after a failure. I found a couple recommendations for forcing npm to use the cache, but those options did not work. But I did find a way to significantly reduce the amount of time npm spends trying to fetch before looking in the cache.
npm config set cache ../my-cache
npm config set fetch-retries 1
npm config set fetch-retry-maxtimeout 1
npm config set fetch-retry-mintimeout 1
npm install async#0.9.0
npm install restify#2.8.3
Be aware that you cannot just type npm install because npm will not use the cache. This is a bit of a pain. If you want a robust install you can write a tiny nodejs app to parse out the dependencies and calls child_process.exec to install each one.
(*) I should mention that there is a package called npm-cache (https://www.npmjs.com/package/npm-cache). In my case npm-cache did not suit my needs. But you may be able to make it work for you.
I am new to node.js and trying to install some packages like express and jade but its getting me frustrated, every time I am encountering different kind of errors some of which are
ENOENT
EADDRINFO
Could not load package.json
I have also googled it but nothing helped me, I am on a wi-fi network provided by our college(cyberoam) and tor-deamon is installed on my linux machine. Any good tutorials to install npm packages properly will be appreciated. Thank you in advance.
Try executing following commands on your command prompt, by replacing proxy address:
npm config set proxy http://proxy.company.com:8080
npm config set https-proxy http://proxy.company.com:8080
I used the node windows installer v0.8.3 to install nodejs.
When I try to install express like this:
npm install express
It's not working. I think that is because my company is using a proxy, so I downloaded express from github https://github.com/visionmedia/express, but I don't know how to install.
I unzip the file and put them in F/express/. Please help me? I'm on Windows
When I try to install from F:/express/ using the following commands
cd F:/express
npm install ./express
or
npm install .
I get the following error:
error: connect ETIMEDOUT
at errnoException (net.js:776:11)
at Object.afterConnect [as oncomplete] (net.js:767:19)
And when when I try to do
npm install F:/express
It shows
express#3.0.0beta7 prepublish F:/express/
npm prune
followed by lots of http get messages and then the same error
express itself has a lot of dependencies which I believe npm also tries to retrieve if you issue npm install. I think you should just configure proxy properly => http://jjasonclark.com/how-to-setup-node-behind-web-proxy?
It would probably be most convenient long-term to configure NPM to use the aforementioned proxy through one of the following methods (In the following, replace $PROXY with your proxy in the form $PROTOCOL://$DOMAIN:$PORT (e.g. http://proxy.server:80))
A. Set the environment variables http_proxy and https_proxy to $PROXY
B.
npm set proxy $PROXY
npm set https-proxy $PROXY
If you have trouble getting packages because of a proxy or other internet connection problem then set up the project on another machine. Then copy the project over to your target. It will have all the files that you need.
Try npm install .\express (assuming the express folder is in the current folder).
The problem is that express in npm install express is parsed as a package name, while .\express in npm install .\express is parsed as a folder name.
You will want to run npm install . from within your F:/express/ folder (or npm install -g . for a global install).
It looks like you downloaded beta version (3.0.0beta7). Try installing the latest stable version (2.5.11):
npm install https://github.com/visionmedia/express/tarball/2.5.11