My Ubuntu server is behind firewall.hence when ever I try to run command to install sails via putty using command npm install sails -g ,I get error Error: connect ECONNREFUSED.
There fore I though if I can download the sails package on to my local and then moving the package manually on firewall server and installing it. I tried looking for some help on web but could not get. Please guide how to proceed
If your computer is not connected to the internet npm will not work.
If you have another computer connected to the internet, you can run the npm commands there and afterwards copy the contents to the other computer. (e.g. via USB stick)
In most cases you should have no problems, even on different operating systems.
Note on global modules: For global modules (e.g. gulp, bower, forever) you will not be able to install into node_modules using this technique. However, you can install them locally by saving them to your package json and running them from their local path.
e.g.
npm install --save forever
./node_modules/forever/bin/forever
Check the files system for the exact path.
Related
How can I install npm package to Node.JS project from hdd. I think admin at work blocked npm.
I installed npm and when I try to write in cmd npm install express for example I got connection timeout.
But I have find back door, I can clone npm package via git desktop from github to hdd.
Somebody can help me ?
You won't be able to regularly install and update packages if your IT team blocked all access to all registries — you would need to essentially make a backup of thousands of packages to your computer for that to work. What you could try is using a different registry, for example npm --registry [registry url] install express. This is a list of some registry mirrors. If your workplace uses JS though, I would talk with the IT team to make sure they can unblock the main registry.
I am working offline without any internet connectivity. I have node JS installed on my system. When I am trying to run the npm create-react-app command it gives me error. Is there any way for me to run npm commands and get react application running offline? Below is the error code I get:
npm ERR! code ENOTFOUND
npm ERR! errcode ENOTFOUND
npm ERR! network request to https://registry.npmjs.org/create-react-app failed,
reason: getaddrinfo ENOTFOUND registry.npmjs.org
and get react application running offline
npm start works offline already. Once you created your application, you should have no problem.
i am trying to run the npm create-react-app command [offline]
Npm is basically a package manager, which downloads dependencies for you, located under /node_modules at your project root.
create-react-app does two things :
Install specific dependencies for React : as a huge framework, React doesn't only require Node.js to run, but also multiple other packages (including React istelf).
Creating a template project with some presets.
If you are working offline and need to create multiple React projects that way, then you'll have no choice but to run the create-react-app command at least once while being online.
However, once you created your first React app, you can just leave the folder untouched : this will give you a fully functional offline copy for your React applications.
When you're back offline, just copy those files to the folder of the React application you want to create (make sure to copy everything, including the node_modules folder). You should then be able to run npm start offline, and build your application.
I believe this is what you are looking for
https://npm.io/package/create-react-app-offline
It helps you create (download) a react project installer, which you can use to create any react JavaScript project offline.
I am trying to use nodejs and npm on a CentOS 7 machine. The machine cannot connect to the Internet, so I copy the node-v6.2.1-linux-x64 folder with some lib modules inside to the machine. But the output shows Error: Cannot find module '../lib/npm.js'. I wonder if it is the correct way to install nodejs offline or modules. Any helps? Thx.
It wouldn't work because the node modules depend to your operating system.
For example , lets say I have a project with tons of node dependencieses and I ran npm install on my Microsoft machine, when I copy my files and try to run it in Apple , it wouldn't work.
You have to use npm i seperetly on different machines.
Maybe this link here can help you to get your npm modules without internet . ==>
https://github.com/npm/npm/issues/1349
I'm new, so please excuse any mistakes.
I am trying to develop a web application locally using XAMPP. I intend to deploy using a hosted web service. XAMPP was a very convenient way to get me up and programming without any fuss.
There are several github javascript libraries that look like they can only be installed with npm. Does this mean that I cannot use them? The specific one that I'm currently having a problem with is: https://github.com/selz/plyr. Or, is it possible to install npm on my XAMPP server? I have a windows machine.
Thank you very much in advance for your help.
is it possible to install npm on my XAMPP server
You will not be installing NPM on your server, you will be installing it on your machine (think of it as a regular program you install on your PC) (if your server happens to be your PC as well, then, well, you are technically installing it on your server)
In order to be able to use NPM though, since NPM is written in JavaScript, you will need to install Node.js, also on your machine.
So, head over to the Node.js site and download and install Node. NPM is included in the installer and will be installed alongside Node.
After that is done, installing NPM packages is simply a matter of heading to your desired directory and executing npm install <PACKAGE_NAME> there.
In general, XAMPP helps you with your back end. Not your front end.
Useful links:
https://docs.npmjs.com/
Does this mean that I cannot use them?
No. You can install node at https://nodejs.org and then use npm through your windows command line to install packages. To test this, just
Install NodeJS
Open Command Line
Make a new folder under your user folder called test mkdir test
cd into that folder on Windows Command Line cd test
Create a new project with npm init -y *note this creates a
package.json file for you
Now you start installing packages with npm install <package>
--save * --save saves the package info in your package.json file (recommended). There is also -g wihch means the package will
be installed globally (usually you don't want this and only want it
locally to your project).
That's how you use NodeJS. If you want to use that with XAMPP then you need to do the same thing but instead of using your user folder (C:\users\yourname) you need to use the htdocs folder of XAMPP (usually C:\xampp\htdocs)
My network doesn't allowed using npm install.
How can I install and use nodemon? Node run only after set PATH variables on windows I tried set the path for nodemon, but I dont have results.
The easiest way to install an npm package is going to be to either tunnel out of your network with a proxy, or to simply install the package while you're on a different network. The reason it's not as simple to just download it is that npm packages have a list of dependencies that need to be installed along with it. Npm takes care of installing the dependency graph for you. If you try to install it manually you would have to manually go over nodemon's package.json file and install all of its dependencies. That might not be so bad until you realize that you then have to go through all those dependencies and install their dependencies, and so on...
I'm not at all affiliated with IPVanish but I recently signed up for their service for the same reason as you. My computer has a VPN configured that connects to an IPVanish server and then my computer tunnels all internet traffic through that VPN. It's nice for simple anonymous web browsing, but more importantly there is no way for network admins here to see where any of my traffic is going. To them it appears that I'm just talking to a random server. They'd have to block every single IPVanish server (and there's a lot!).
There are other alternatives but that one had good reviews and it's only $10 a month. I haven't tried any others but I'm sure they're just as good.
If tunneling out of your network or installing the module on a different network isn't an option, I'm happy to install it myself and upload a zip of the completed install to Google Drive so you can just extract it to the global npm folder. However, that would obviously not be a permanent solution for you and even though I have good intentions, you don't know me and I don't recommend downloading random stuff off of a stranger's Google Drive.
I recommend getting a friend to do the following from another network:
Install nodemon: npm install -g nodemon
Find where global npm modules install to: npm config get prefix
Navigate to the global npm module path, find the nodemon directory, and zip it up.
Email/Dropbox you the archived module.
On your machine figure out where global npm modules install to: npm config get prefix
Extract the nodemon zip to that location.