NPM / gyp error when installing redis - node.js

Full error/warning log: http://pastebin.com/xNjC4FDr
I had problem as well when I tried to install MongoDB, I have made SO question of it but, that was only warnings, so I could ignore it. But this time it's not only warnings, but also red error.
What do I have to do? Is my Nodejs messed up because I've installed Visual Studio Tools for NodeJS in the past? Or is this normal behavior? What can I do about this, I prefer not to see errors/warnings when I install something on NPM.

The problem is that hiredis does not support Windows currently. The link to the Windows-compatible fork in the hiredis readme seems to be outdated (last commit in 8/2013 as of this writing), so you may be out of luck.
However hiredis is not required by the redis module, it's an optional dependency that just makes parsing the redis protocol faster than the pure JavaScript parser that is bundled with redis. You may see a similar thing with other modules that have optional dependencies like this. Typically if you see the module tree outline at the end of the console output, that means the module installation was successful.

Related

#tensorflow/tfjs-node: sudden craving for aws-sdk, nock, mock-aws-s3

System information
OS Platform and Distribution (e.g., Linux Ubuntu 16.04): macOS Ventura 13.2.1
TensorFlow.js installed from (npm or script link): npm
TensorFlow.js version: 4.2.0
Describe the problem
I had previously used the #tensorflow/tfjs-node library successfully with no issues. Now, however, I have changed environments and unfortunately I am running into issues. I don't have the original source code any more to compare to see what the difference is.
I am running under node v18.4.0, although I have tried v16.16.0 and v14.21.2 (using nvm on macOS).
The problem is now it seems the library wants all sorts of supporting modules, which are not installed:
aws-sdk
nock
mock-aws-s3
It will not build without these, so I npm i them and then it builds happily.
So first question: why might my environment now be needing these where it didn't need them before? What might be different? As I say, sadly I don't have the last environment around any more.
Having built this, I now receive the error:
Error: #package/learn package.json is not node-pre-gyp ready:
package.json must declare these properties:
binary
Although I could configure all this, I think it is the wrong thing to do, since I had it up and running previously without any of this. Is where are these issues now coming from?
Can I run the #tensorflow/tfjs-node without installing or needing those three dependencies? I can provide the other config if it is not apparent to someone who has had the same issue.

Which version of Socket.IO am I running?

Recently, I installed a new version of Socket.IO with npm. I tried using npm update socket.io, but that didn't seem to work for me because when I checked the version using npm list socket.io, it didn't show as a new version. So, I just used npm install socket.io, which seemed to work, because if I now go to Command Prompt, and enter the command npm list socket.io, I get this:
Brackets is my code editor, and this seems to indicate that it has its own installation of Socket.IO. is this a correct assumption? Anyway, before installing the new version of Socket.IO, the part saying socket.io#2.2.0 wasn't there.
So how do I know which one I'm running? I think it should be 2.2.0, but before installing it, because there was only the 1.1.0 version there, so I must've been originally running that.
By the way, what does extraneous mean in this sense? Thanks for any help.
Try this command, it will tell you the version which is currently being used for the project:
node -p "require('./package.json').version"
And also, it looks like you have a package.json file in brackets directory. I have no idea why. Maybe, it was installed as a part of dependency or it is a dependency.
But if you working in that directory/path, i.e.,
C:\Users\William\node_modules\brackets, socket.io will use version 1.1, otherwise for any other directory/path it will use the version 2.2.
I hope it clears your doubt.

"no template named 'WeakCallbackData' in namespace 'v8'" error when installing npm packages

Some packages that depend on https://www.npmjs.com/package/fibers fail to install with error message above. Particularly it is iron-meteor.
Homepage of the fibers states:
meteor users please read this
If you're trying to get meteor running and you ended up at this page you're probably doing something wrong. Please uninstall all versions of NodeJS and Meteor, then start over. See meteor#5124 for more information."
But it does not seem to be very helpful.
One guy recommends to downgrade node.js here https://github.com/NativeScript/NativeScript/issues/2991
It helps indeed, but it is kind of hack, right?
Node version affected: v7.2.0
Node v6.9.2 works well.
WeakCallbackData was removed from the V8 API earlier this year. Since this change has landed in Node 7, packages that rely on v8::WeakCallbackData don't work anymore. You need to downgrade Node or wait until Meteor supports Node 7, i.e., uses a newer node-fibers version.

How can I unflatten the node module?

My current npm version is 3.7.3 . Previously, only the required packages were getting installed in my node modules. But right now they have all flattened and have 100 + folders visible when I look into node modules. I prefer the older way where you could go into individual folders and see their dependencies.
here is a similar thread:
Why does npm install many packages into "/node_modules" instead of only one?
I tried running npm uninstall without much success.
Basically, you are out of luck... NPM does not provide any configuration options regarding this. It will nest dependencies if it must in order to resolve version conflicts, but only in this case. Your only option is to downgrade NPM (not recommended). However, if you just need to see the dependencies nested for informational reasons, you can use npm ls. It will draw you a graph.
See this relevant NPM issue for more discussion: https://github.com/npm/npm/issues/9809
Now that node js' LTS doesn't include an NPMv2 I found myself stuck with this issue again.
For those of you also caught out, the link that #KevinBurdett mentioned, also has some answers.
You can force downgrade npm using npm itself (using sudo or equivalent for this). From https://github.com/npm/npm/issues/9809#issuecomment-179702479:
as root I simply do npm install -g 'npm#<3' on my system every time I
a new version of Node comes out; your mileage might vary, but it's
fairly trivial to "downgrade" :-)
Another alternative is to use the Node Version Manager (NVM): https://github.com/creationix/nvm. Your mileage may vary depending upon personal config/preferences/platform.
That said, npm 3 and the issue of flat dependency trees will be with us from hereafter... It's probably high time to start accepting that change.
My personal grudge with this is that it makes the node_modules folder incredibly difficult to work with in an IDE, especially when you need to look at the implementation of your immediate dependent modules, without first wading through 100's of sub-sub modules that are irrelevant to me. It seems that I'm not alone in this matter when you read the comments in the issue. It only leads me to question the viability of npm itself when such changes are made without a proper migration from old to new systems. For me, npm2 will always be king.

What does npm mean for socket.io/installing stuff?

I'm a real noob at this. I've just began scratching the surface on node.js/socket.io/html5 and stuff. I finally figured out how to use my command prompt (using windows) to launch a "hello world" application with the command "node example.js." But what does npm mean? When I'm looking at socket.io it says to install, npm install socket.io Does that mean I need to extract all the files into my nodejs folder?
I'm confused.
npm is a generally awesome program for managing packages and dependencies (especially while you have a network connection). It does lots of fancy things and is most commonly used with node.js projects. That said, it's an unfortunately common misconception that the acronym stands for "node package manager".
In reality, npm doesn't actually stand for anything as it's not an acronym. With taglines like "no problem, meatbag" the npm organization playfully resists the trend of acronymization. It should always be referenced in lowercase to avoid confusion with the National Association of Pastoral Musicians.
npm is a command line interface program to manage node.js libraries (it stands for node package manager - at least it did initially, they since turned this into a bit of a running gag - thanks to #spex in the comments for that link). Check out the docs, it is awesome and amazing. As you mentioned, just type npm install in a command prompt, and voilĂ , you have the library in your local node modules.
npm is stands for Non-Parametric Mapping utility written by Chris Rorden...
But we can keep it as Node Package Manager and it is very helpful for Module Loader which uses CommmonJS module pattern, and I am not sure will Node will support the ES2015 Module Loading Syntax (Built in module Loading Syntax)?
for those who are wondering the same thing, you just type npm install socket.io in the command prompt where nodejs file is.
C:/Program Files/nodejs
That should be what your command prompt should say and then just type that in.

Resources