Understanding Node.js Nowjs Module Installation

Asked 2 years ago, Updated 2 years ago, 65 views

We tested a sample program in the Node Cookbook that uses nowjs to share functions with clients and servers.

First, we installed the following now modules:

$npm install now
   ... Abbreviated... 
  >Downloading now CLI 7.1.1 [====================] 100%
   ... abbreviation
  added1 package in 114.299s

Next, we ran the program.

$node server
    module.js —487
    below err;
    ^
   Error: Cannot find module 'now'

An error appears to have occurred in the following parts of the program:

...omitted...
var everyone = require('now').initialize(plainHttpServer);
...omitted...

The now module destination directory contains the following:

-- --download
│ -- -- dist
│ │ d --download.js
│ -- --now
│ ----install.js
├-- license.md
├-- package.json
└-- readme.md

There is no file in the directory named 'now.js' and there is a binary named now.
Invoke this now to request an email address.It feels like a registration program for PAAS service provided by zeit.

Therefore, please let me know how to install the nowjs module.

In addition, our operating environment is as follows:

Hosts:Windows 10
Guest: Ubuntu 15.10
 VMs:VirtualBox 5.1.6

javascript node.js npm

2022-09-30 16:11

1 Answers

I don't know about the library, but I think it's different from nowjs that it's registered as now in npm.I think the information in the book is out of date.

I looked for nowjs in npm, but I couldn't find it.github had those thresholds.However, it hasn't been updated yet and there aren't many people using it, so I recommend using Socket.io instead.


2022-09-30 16:11

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.