Is the npm install debug output a standard format, and if so, what is it? - npm

Upon npm install, logs such as npm WARN ... are outputted.
These seem to be of the same format, but I have also seen npm notice ...
The standard seems to be npm type text followed by a new line.
Is this correct?
Is there a list of types?
Is there a standard listed
anywhere?
※ I ask this, as I am interested in handling WARN and other events.

There isn't any official documentation about logging in npm anywhere. The best solution to what your trying to do is to find a multitude of use cases and examining the debug log files of each to see what the different types of log messages are (warn, notice, error, info, etc.), and then decide what to do from there. If you want to start writing a library, take what exists as a starting point and start from there.
You can also request some documentation on the official npm issues forum, which I see you've already done. It's an idea worth discussing with the community.

Related

Using "force=true" in .npmrc triggers warning message: how to disable it?

In my project we have some dependencies that work well together but their versions have some conflicts, and this forces us to use --force whenever we want to run npm i.
To avoid confusions and errors between developers, I've created an .npmrc file with the force=true parameter so it runs with --force by default:
package-lock=false
force=true
However, this does not only affect the install script, but also others like start and test, which makes an annoying warning message to appear over and over again:
This message appears in the middle of other printed messages in console, and it appears many times. When executing tests, it also appears in between console.log and other traces, making them hard to read as it just replaces the content. This is the trace of a failed test:
Is there any way I can disable this warning message (or make it appear just once, as it should be)?
Although this does not solve exactly the problem, it gets rid of it. Add --loglevel=error as a parameter or, if you're using an .npmrc file, just add:
force=true
loglevel=error
This will get rid of the WARN messages.
However, this does not solve the initial problem, as those WARN messages should not interfere with other log traces in the console in the first place, and that they should be squashed to be shown just once and not so many times as they offer no valuable information and just add noise to the traces.

dbt deps command results in "Unable to connect to registry hub"

When running dbt deps, I get back this error message:
Running with dbt=0.17.0
Error sending message, disabling tracking
Encountered an error:
Unable to connect to registry hub
What's happening here, and how can I work around it?
First of all, it's worth understanding what's going on here. It looks like you're trying to install a package from the dbt hub site (hub.getdbt.com) — if you open up your packages.yml file, you'll find something like this:
packages:
- hub: package-owner/package-name
version: 0.1.0
When you run dbt deps (at a high level):
dbt sends a request to hub.getdbt.com
From hub.getdbt.com, a request is sent to GitHub to download the package.
The package is copied into your project
This error occurs if dbt cannot connect to the hub site after sending a network request repeatedly. First off, we recommend you retry the dbt deps command — sometimes it's just a blip in connectivity that goes away on the second try.
If the error persists, there may be a few different reasons for it:
hub.getdbt.com might be unavailable. This happens but is relatively rare. You can navigate to hub.getdbt.com to check if this is the case. Also check the Netlify status page to see if there are any issues.
GitHub might be down — you can check this by going to the GitHub status page.
Finally, it may be that a firewall rule or antivirus software on your computer is rejecting the request. Talk to your IT team to find out if this is the case and whether that restriction can be removed.
We generally recommend using the hub syntax for packages, however if you need to work around it, you can consider using the git syntax (docs) or installing the package from a local directory (docs)

Understanding NPM vulnerability - tunnel-agent

So I have a vulnerability in a package named tunnel-agent. After running npm audit the packages which depend on this package are listed:
gatsby-plugin-sharp
OK great, I update this and everything is fine? NO.. Still listing as vulnerable, so now I start on the rabbit hole of looking where this leads.
Running npm list tunnel-agent I get to find out who's depending on this package.
So now the vulnerability is fixed in tunnel-agent#0.6.0but I've got one thing saying it's using tunnel-agent#0.4.3. But this is in the same package gatsby-plugin-sharp so why's it not fixed?
I head off to github issues and find that because gatsby-plugin-sharp uses imagemin-mozjpeg > caw#1.2.0 > tunnel-agent#0.4.3 I'm still stuck right?
So what I'm asking is, without relying on plugin authors to update their dependencies, how would you go about using caw#2.0.1 which then uses tunnel-agent#0.6.0 to remove this vulnerability once and for all?
This is all environment variables.
But you could fork the open pull request that have not been merged published. Then create your on npm packages that have the fixes.
https://github.com/request/tunnel-agent/pull/45
yarn negates these errors.
And ‘yarn’ doesn’t have these issue. Since it is designed for local scope.

Gulp error - EISDIR: illegal operation on a directory

I would like to expose my problem here because I have been struggling for several weeks to configure Gulp stably on my Raspberry server.
When I run Gulp within my project, I always have the following error lines that appear :
enter image description here
The research I conducted with this concern did not lead me to anything. I was confronted with this problem three times: the first two times, I completely reinstalled the NPM extensions by having to use the --unsafe-perm prefix. This solution worked on the moment but when I had to restart Gulp, the problem reappeared. Today, even by reinstalling Gulp and NPM modules that I use, I always get these lines of errors, no matter what solutions I try, nothing is conclusive: changing permissions etc ...
Do you have any leads to tell me?
Thanks in advance (and sorry for my English, I'm French!)

Npm registry error when installing msgpack-x

When I execute
npm install msgpack-x
I get an error which says 'msgpack-x' is not in the npm registry.
I am very new to this, any idea what I might be missing?
Use the registry JSON dump to see if the file is there:
Search for it in your search engine of choice, for example:
site:registry.npmjs.org msgpack-x
domain:registry.npmjs.org msgpack-x
If it's there, find the name that comes after {"_id":
Use that in your npm install, for example:
npm install msgpack-js-browser
References
7 Things A Search Engine You've Never Heard Of Has Over Google And Bing
Perform Site Specific Search With Google, Yahoo and Bing
Search engine search techniques - Emlev