how to manually install npm package or node.js with full setup? - windows

I am a php developer. For easy installation of php+apache+mysql there is WAMP, xampp, etc.
my internet connection is bad quality. and unable to use npm install. i want download a single setup file that installs node.js, socket.io, expressjs and etc

I am not aware of any package similar to WAMP for Node.js. Nonetheless, you can grab Node.js Windows installer from here: http://nodejs.org/#download. Please note that the only embedded tool is npm.
If you can not use npm directly, getting all the dependencies will be a real mess. Most of the packages you will need (socket.io and express for example) in turn have multiple dependencies.
Anyway, it is still possible to use npm from manually downloaded files. Look at http://npmjs.org/doc/install.html for more informations.

You can download packages manually at http://search.npmjs.org. There is no single setup that downloads any possible configuration of npm packages, you would have to download them one at a time but that should be able to grab them even on a very slow connection.
The other option would be to grab them directly from their GitHub location since that's where most of them are hosted. You could sync the source using git and then install them. That should also work on a slow connection.

Related

Hybrid Composer/FTP Drupal 8 workflow questions

Is it ok to use composer on localhost to upgrade core and modules, and then FTP the files to the server?
I'm on shared hosting, and although it's possible to use SSH with GIT, it's a pain to set up...
Some information about my use case:
No multiple users, no team, no multiple developers, I'm a one man show
Small business sites
I'm the only person adding content
No need for version control, no module development, no coding
I'm a site builder, and the only code I touch are the CSS files of the theme. Will this workflow be ok?
Install Drupal 8 with composer
Import site into aquia dev desktop
Use composer to update modules and core
FTP sites folder to server
Use backup migrate when I alternate working from live to localhost and vice versa
The question is very general and, I think, it has some "conflict" of ideas.
Your question:
Is it ok to use composer on localhost to upgrade core and modules, and then FTP the files to the server
Technically yes. But this method has lots of disadvantages:
DR (Disaster Recovery) - What if you uploaded something that doesn't work? How quickly can you recover? With git its a matter of git checkout
Composer is environment-agnostic - When you run composer install, composer checks some dependencies in you machine and then decides what to install. What if you are missing some required packages in you remote machine? To fix this you should run composer install on the remote machine (via ssh)
FTP might take too long to finish - As apposed to git (or rsync) FTP will upload all files to the server. Other tools will upload just the diff between previous version and the current. So I will always choose rsync over FTP
Security - use SFTP
Your question:
I'm a site builder, and the only code I touch are the CSS files of the theme. Will this workflow be ok
Sounds correct - but remember the composer issue..

Adding Additional packages to Anaconda Installer

I am curious to know if there are methods where I can add additional packages to the anaconda installer. I am basically looking for a solution for creating an anaconda installer which has some extra python packages added along with it. Thus the participants to whom I give the installer need not be worrying about Internet connectivity or to add additional commands.
This is meant for an introductory hands-on python session. Hence the objective is to make the whole installation process less confusing as possible to the participants of the session.
I am aware of using docker as well as using environments. I am looking for something more simpler, say as seamless as anaconda installation for my participants.
Currently, I am thinking of doing the following.
1) Provide the .tar.gz file of the packages along with the installer
2) After installation and creating environments, install the libraries using pip from the .tar.gz
python -m pip install c:\mymodule\great.tar.gz
Any method which is simpler than the above one is welcome.
From the conda documentation on creating custom channels:
If you do not wish to upload your packages to the Internet, you can
build a custom repository served either through a web server or
locally using a file:// URL.
The instructions on that page tell you how to create a local custom repository from conda packages. They're aimed at people who are building their own packages but as far as I can see you can also use the existing packages that you can download from the repositories at https://repo.continuum.io/pkgs/.
You can then use the file:// URL of that repository in the -c specification of conda create and/or conda install commands to set up the environment for your users to work in.

Composer portable mode?

help me please:
My case
I have a manually mounted WAMP server using separate packages on drive E:
I did this, so that when I format my computer, I do not have to install it again.
For now everything works very well and little by little I have been making changes in the configurations to make tests.
Today I learned that there is "composer" which allows to manage dependencies for PHP projects.
I downloaded it and installed it (which is very easy).
My question
When formatting my computer and "reactivating" my WAMP, do I need to reinstall composer? Or can I use it as if it were portable?
Composer is just a collection of PHP files, conveniently tied together in one file with the .phar file format (and probably with or without .phar extension). You should be able to either install Composer again, or download that Phar file again if it got lost.

How to install a Chocolatey package completely offline?

I need to install software on Windows clients that are completely offline. That means they have no Internet access.
An example. Let's say I want to install Paint.Net. I go to a reference machine (with INet) and install Paint.Net with Chocolatey.
choco install paint.net -y
After the install is finished I have the software installed and two artifacts:
The package file "paint.net.nupkg" in %ChocolateyInstall%/lib/paint.net
and
the the installer file "paint.net.4.0.6.install.zip" in %Temp%\chocolatey.
I now put these two files on a USB stick. Then I go to the offline machine, plug in the USB stick and want to install the package.
Is it possible to install the software without modifying the package? I am aware that inside the nupkg file there is a tools/chocolateyInstall.ps1 file with a $url variable defined. But I want to install the package without changing the package content or modifying the URL by hand.
I played around with the parameters --cache and --source but with little to no luck.
I have seen that this kind of question is asked before. But never (to my knowledge) with the intend to run the installer file from the stick too (and not only the package file). So I hope this is not a duplicate.
Caching Downloads - Not Deterministic
While there are ways to set the original nupkg (with the version on it, not the one in the packages directory - use download from left side of package's page on the Chocolatey community package repository) and the cache onto a USB stick somewhere, it's not always deterministic that it will work. You can also override the cache location, so that the folder is somewhere not in TEMP. See choco config, choco config -h and choco config set cacheLocation c:\some\location to do this.
Create Your Own Packages - Better
For packages you need offline, you have the ability to manage your own packages and you can embed software right into the package. This is desired when you want to manage software offline as most things on the community repository are subject to copyright law and distribution rights (why they don't simply have the software they represent embedded).
Creating and working with your own packages is very secure, reliable, and repeatable (and can be completely offline), but it does tend to take up time. If you are doing this for yourself, then it could override any time-savings you get as a consumer using Chocolatey and the community repository.
Internalized Packages - Best
The best thing you can do here is a process called internalizing, where you download and extract the package, download all of the resources and embed them in the package (or put them somewhere local/UNC share), edit the scripts to use those embedded/local resources and recompile the package.
This allows you to take advantage of existing package logic without the issue of the internet.
For more details see Recompiling Packages and Package Internalizer - Automatically Recompile Packages.
NOTE: As a side note, we are thinking of offering the ability to auto recompile with Chocolatey Pro edition and not just the Business edition.
Organization Use of Chocolatey
Most organizations using Chocolatey are doing some combination of creating packages and recompiling packages, because they need absolute trust and control over those packages when being used in production scenarios.

PHP-Composer, locally installed, remote installation need?

This is a very simple question and I think that there will be someone who will mark me down for this, but I developed in PHP / CakePHP on my local Ubuntu system, and then install / ftp my code to my hosting company.
With CakePHP which is only PHP code, there is nothing to install, you have to set-up DB connections e.c.t but that is simple stuff but I have just come across PHP Composer, looks very easy to use and install locally.
My question is does it need to be re-installed on my hosting server, e.g once the code / php archive file is loaded into my project and its all working do I need to re-install it via SSH / curl, if so this might not be usable has I would not have access to my server to install it as root but it is only downloading code archive PHP file for use then would this work?
Sorry again for the newbe question but I can not seem to find a simple answer to my question.
Many Thanks
Glenn.
No, you'll be able to run Composer locally and then ftp the result to the target server. This is the preferred setup, because otherwise you'd need a shell on the remote server, or some replacement, and that could mean less security, or it is even impossible with most shared hosting.

Resources