How can I monitor the requests during 'npm install <package>'? - http

I wish to monitor the calls made by the npm cli to the npm registry.
(I am building my own registry)
I have tried using a program, Charles for monitoring requests on my machine, (Macbook Pro 2021 Monterey), but no requests of interest appeared while using the npm cli. I also tried using Activity Monitor native to macOS, but I could not figure out how to identify the requests.
I have also tried installing Wireshark, but I am unable to gain access rights to monitor requests.
How can I monitor requests during 'npm install '?

Related

Artifactory OSS 7.46.11 version not getting installed in Windows 10 laptop

I am not able to install JFrog Artifactory OSS version 7.46.11 in my Windows 10 laptop.
I am trying to setup Devops CI/CD pipeline using Jenkins in my laptop for my hands on Devops skills. I tried to setup Artifactory OSS 7.46.11 version in my laptop. However, I am not able to install the software. Even I tried to install as a service but in vain. I have enabled the ports as well. I tried setting up the JVM parameters as mentioned in the JFrog documentation.
Can someone help me in this.
Thanks.
Are you facing the issue while installing Artifactory itself or installation is successful but unable to start it?
you can try the below things.
Navigate to %JFROG_HOME/artifactory/app/bin directory and you will find a file
Open Power shell and try to run the artifactory.bat file.
This give you better idea on what is happening.
Navigate to %JFROG_HOME/artifactory/var/log folder where the complete logs will be printed. Try to focus on the below log files.
artifactory-service.log
access-service.log
router-service.log
This should reveal some useful information. If you could find anything, share the Error snippet from artifactory-service.log

Using C/C++ Modules in Meteor Tutorial

Does anyone have a tutorial how to use a C++ module from NPM in Meteor? Running the normal: meteor npm install and importing with the package returns this message.
Error: module.useNode() must succeed for native .node modules
You're probably using an unusual server configuration. Some common problems that break compilation are:
Incorrect permissions for various directories. This may mean you've been running as root for some meteor installation commands, which then prevents the local user's access to those directories for compilation.
A missing or broken compiler toolchain.
A bad package or one that is untested for your hosting platform.
I'd discourage you from trying to run locally on an desktop Linux installation if you're unfamiliar with some of these gotchas. Use a virtual machine for development. I'd recommend Vagrant using IntelliJ's WebStorm for native integration.
Meteor is generally deployed on Linux using the Amazon AMI or Ubuntu on AWS, Galaxy or Modulus.
If you think everything's in order and you're having issues with Galaxy or Modulus, reach out to their support.

Can't start Cordova debugging to iOS simulator

I've followed the instructions at the link below to "Build and simulate a Cordova iOS app in the cloud". https://taco.visualstudio.com/en-us/docs/build_ios_cloud/
After completing the instructions I'm able to build and get the iOS simulator working, however, I'm unable to attach a debugger.
The message displayed in remotebuild is:
GET /cordova/build/5655/debug 500 10.865 ms - 28
In Visual Studio I see the following in the Debug window:
Starting launch process C:\Program Files (x86)\nodejs\node.exe "(redacted)\node_modules\vs-tac\emulator.js" --platform ios --action launch --path "(redacted)\buildInfo.json" --serverUrl https://(redacted):3000/cordova --certificateName (redacted) --language en-US --loglevel info --cliVersion 5.4.1 --npmInstallDir "(redacted)" --deployTarget "iPhone 5"
Timed out connecting debugger to remote Apache Cordova app. See Output window for JavaScript console output.
------ Cordova tools 5.4.1 already installed.
Requesting emulate on iOS Simulator for buildNumber 5655 on server https://(redacted):3000/cordova...
Emulated - Successfully sent to ios Simulator
------ Cordova tools 5.4.1 already installed.
Requesting debug on remote iOS device for buildNumber 5655 on server https://(redacted):3000/cordova...
Failed to Debug iOS remote for build (redacted)\buildInfo.json to https://(redacted):3000/cordova :
iPhone 5
My local development machine is using Visual Studio 2015 and Cordova 5.4.1. I have Node v0.12.2 installed locally and v0.12.9 installed on the MacInCloud. Following the instructions in the link above, I am NOT an admin on the Mac machine.
I've also already tried the instructions suggested in this SO answer: Visual Studio Debugger failing to connect to remote Apache Cordova app in iOS simulator
All the suggestions and the links provided by others were helpful but ultimately my assessment of the problem was not being admin/root on the Mac. The Visual Studio Cordova docs linked in my original question would suggest that you can do all that you need on a Mac without having admin/root access but in my experience that is just not the case.
To the credit of the MacInCloud group, they were very helpful in making changes that I requested to permissions and for reinstalling packages such as brew, ios-webkit-debug-proxy, remotebuild, etc... but after a while that back-and-forth kind of approach to fixing the issue proved painful. When I switched from a Managed MacInCloud server to a Dedicated one, everything worked almost immediately.
Looking back I think the initial execution of remotebuild, which executes brew -- without being admin on the box -- caused the whole process to go south. I was warned when I ran remotebuild for the first time that it would install some brew components that might need root access. That should have been a warning sign to me that not being admin on the box was going to be an issue...
Even though I was able to get a Dedicated MacInCloud server working, the lesson I learned about having control over the Mac prompted me to just buy a Mac Mini. That was a little more difficult to setup because I was now doing everything myself, but ultimately I think it will pay off in the end.
For anyone else struggling with similar issues here is a brain dump of some things I learned along the way:
You don't necessarily need to get Visual Studio talking to the Mac to debug Cordova applications. You can use Safari Web Inspector from the Mac. https://blog.nraboy.com/2015/10/debugging-your-apache-cordova-ios-app-with-safari/. Even though I finally got VS working, I actually prefer this because it is more like Chrome's debugger which I prefer to Visual Studio's.
The ios-webkit-debug-proxy NPM package mentioned in other comments and links is basically a proxy which Visual Studio uses to debug the simulator in exactly the same way Safari does as mentioned above. For this proxy to work you must also be allowed to connect to the Mac over ports 9221-9322. https://github.com/google/ios-webkit-debug-proxy. Prior to learning that I thought I only needed port 3000 open for the remotebuild proxy...
The package necessary for launching the iOS simulator from remotebuild is ios-sim and it will occasionally timeout when launching the simulator and cause the debugger not to attach. This is a known limitation. https://github.com/phonegap/ios-sim and https://blogs.msdn.microsoft.com/visualstudio/2014/11/13/tools-for-apache-cordova-update-ios-debugging-windows-8-1-support/ (see comments).
If you should feel the need to install/uninstall brew it is very easy to do. Just run the install script and if already installed it will give you instructions on how to uninstall. http://brew.sh/ and https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/Troubleshooting.md#troubleshooting. To uninstall or reinstall a NPM package is equally easy and Google is your friend.
Read and re-read both of these links for setting up a Mac: https://taco.visualstudio.com/en-us/docs/ios-guide/ and https://taco.visualstudio.com/en-us/docs/build_ios_cloud/. Getting the RemoteBuild.config right is crucial for getting secure connections to work -- especially if you want to access your Mac Mini at home from across the internet.
If you are remoting to a Mac I highly recommend iRAPP or some other VNC alternative. My experience has been that VNC is painfully slow and having a bad connection when you're troubleshooting issues just leads to more aggravation. http://www.coderebel.com/products/irapp/
As mentioned above, the MacInCloud guys were great when I asked for support, but if you do need root access for more than six months the cost of a Mac Mini is less than a Dedicated server plan.
Cheers
Since it is the call to /cordova/[...]/debug that is failing it looks like you might not have ios_webkit_debug_proxy installed. You could try making sure that homebrew is installed (from http://brew.sh) and running brew install ios-webkit-debug-proxy. Afterwards you should be able to run ios_webkit_debug_proxy without an error.
If that runs successfully then you should be able to quit out of ios_webkit_debug_proxy and debugging should work via remotebuild.

How Can I run two versions of Sonatype Nexus on the same machine?

so i just started working on a project, and my task is to upgrade sonatype nexus 1.9.x running on CentOS6 to 2.11.x. The old version is currently deployed via a war file. The goal is to get the new version deployed while not breaking builds when devs try to build their project.
My plan of attack is to download nexus. Make the current nexus that is deployed via tomcat, run on a different port, make the new nexus run on the current port, then proxy the old nexus.
Im running into a couple problems though. the old nexus uses java 1.6. If update java to 1.8, would this break the current running nexus?
Would I be able to run two version of nexus on the same vm? If so, how would i do that and minimize the change of messing something up?
Thanks everyone. Im just starting out and this is all very new to me.
Since you Nexus install is very old you have to consider your options:
You could upgrade the existing instance. 1.9 is VERY old so you have to upgrade in multiple steps. First to 2.0, then 2.7 and then 2.11. This is necessary due to data storage changes for configuration and removed upgrade steps.
You could just reconfigure a new server from scratch with the same configuration in terms of repositories and other things and simply rsync the repsitories over to the new storage. You really only have to do this for hosted repositories since the proxy repositories will hopefully still be online and you will just download whatever is requested anew.
If your setup is not too complex I would personally go with option 2. It gives you a chance to revisit things and clean up your setup.
For that setup the steps are roughly.
Install Java 8 in parallel to Java 6
Install Nexus 2.11 from the bundle so it runs with Eclipse Jetty. Do NOT try to run on Tomcat.
Configure it to run on port 9081 or some other non-conflicting port with your original setup and do all the other config including creating the repositories as desired as well as security setup.
Now you should be able to have both servers running.
Create a script that rsyncs the repositories (located in sonatype-work/nexus/storage) and run it with the new server offline
Start the new Nexus in parallel and run a number of tests against it.
Once you have confirmed everything is working plan for a specific time for the cutover and do this
Disable any deployment to Nexus (CI servers, tell people, switch hosted repositories to read only)
Run the rsync script one last time
Turn the old Nexus server off
Configure the new server to use the port of the old one
Start the new one up
You are done. Everything should be good now so the last step is to delete the old Nexus and Tomcat setup.
There are various variations for this process of course. Here are some tips for the rsync.
Also feel free to ping us on the mailing list or chat for further help and check out the comprehensive documentation as well.

running grails locally with no external network connectivity

I was trying to run grails on a computer with no internet connectivity but was not able to do so. The error I observed is copied below.
Error Resolve error obtaining dependencies - Failed to read artifact descriptor for xalan:serializer:jar:2.7.1
Error Required Grails build dependencies were not found. This is normally due to internet connectivity issues or missing repositories in grails-app/conf/BuildConfig.groovy. Please verify your configuration to continue.
I could not locate any config settings that I could change in BuildConfig.groovy or any other groovy file that would allow me to run a grails app (on Windows) with no internet connectivity. I am sure there must be some settings which allow me to run a grails app without internet connectivity - can anyone possibly shed some light on this?
Thanks
You don't need Internet connectivity to run grails app locally.
But you need to have your app dependencies downloaded in local Ivy cache - so you need Internet connectivity at least for the first run/compile of your app.
After that you should be able to run it without Internet connectivity.
Though Grails does not require internet conncetivity to run, the Grails software relies on other code which is hosted online. You will need to either download all of the dependencies, (I'm not sure where you would even find them all), or connect to the internet for your initial run.
Once you are online, type grails run-app in the console, let that download all the dependencies, then feel free to take it offline!

Resources