I
I
incel2018-11-20 09:35:00
Command line
incel, 2018-11-20 09:35:00

How to include a package with node.js manually?

Put express.tgz in c:/node and ran the following commands:

$ cd c:/node
$ npm install ./express.tgz

Result:
npm ERR! code ECONNRESET
npm ERR! errno ECONNRESET
npm ERR! network request to https://registry.npmjs.org/depd failed, reason: read ECONNRESET
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly.  See: 'npm help config'

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\%username%\AppData\Roaming\npm-cache\_logs\2018-11-19T15_32_29_036Z-debug.log

It seems to be doing the installation manually, because. the server is offline, without access to the Internet, and npm is still torn to its servers. How to get rid of it?
How to install the package correctly?
Thanks
I am attaching the contents of the log file.
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'install',
1 verbose cli   './express.tgz' ]
2 info using [email protected]
3 info using [email protected]
4 verbose npm-session 63b80a8effda4353
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 silly pacote file manifest for [email protected]:express.tgz fetched in 222ms
8 timing stage:loadCurrentTree Completed in 1147ms
9 silly install loadIdealTree
10 silly install cloneCurrentTreeToIdealTree
11 timing stage:loadIdealTree:cloneCurrentTree Completed in 2ms
12 silly install loadShrinkwrap
13 timing stage:loadIdealTree:loadShrinkwrap Completed in 24ms
14 silly install loadAllDepsIntoIdealTree
15 silly resolveWithNewModule [email protected] checking installable status
16 silly removeObsoleteDep removing [email protected] from the tree as its been replaced by a newer version or is no longer required
17 silly fetchPackageMetaData error for [email protected]~1.1.2 request to https://registry.npmjs.org/depd failed, reason: read ECONNRESET
18 silly fetchPackageMetaData error for [email protected] request to https://registry.npmjs.org/content-disposition failed, reason: read ECONNRESET
19 silly fetchPackageMetaData error for [email protected] request to https://registry.npmjs.org/cookie failed, reason: read ECONNRESET
20 silly fetchPackageMetaData error for [email protected]~1.3.5 request to https://registry.npmjs.org/accepts failed, reason: read ECONNRESET
21 silly fetchPackageMetaData error for [email protected] request to https://registry.npmjs.org/array-flatten failed, reason: read ECONNRESET
22 silly fetchPackageMetaData error for [email protected]~1.0.2 request to https://registry.npmjs.org/encodeurl failed, reason: read ECONNRESET
23 silly fetchPackageMetaData error for [email protected]~1.0.4 request to https://registry.npmjs.org/content-type failed, reason: read ECONNRESET
24 silly fetchPackageMetaData error for [email protected] request to https://registry.npmjs.org/body-parser failed, reason: read ECONNRESET
25 silly fetchPackageMetaData error for [email protected] request to https://registry.npmjs.org/cookie-signature failed, reason: read ECONNRESET
26 silly fetchPackageMetaData error for [email protected] request to https://registry.npmjs.org/debug failed, reason: read ECONNRESET
27 silly fetchPackageMetaData error for [email protected]~1.3.2 request to https://registry.npmjs.org/parseurl failed, reason: read ECONNRESET
28 silly fetchPackageMetaData error for [email protected] request to https://registry.npmjs.org/finalhandler failed, reason: read ECONNRESET
29 silly fetchPackageMetaData error for [email protected]~2.3.0 request to https://registry.npmjs.org/on-finished failed, reason: read ECONNRESET
30 silly fetchPackageMetaData error for [email protected]~1.8.1 request to https://registry.npmjs.org/etag failed, reason: read ECONNRESET
31 silly fetchPackageMetaData error for [email protected] request to https://registry.npmjs.org/path-to-regexp failed, reason: read ECONNRESET
32 silly fetchPackageMetaData error for [email protected] request to https://registry.npmjs.org/fresh failed, reason: read ECONNRESET
33 silly fetchPackageMetaData error for [email protected]~2.0.4 request to https://registry.npmjs.org/proxy-addr failed, reason: read ECONNRESET
34 silly fetchPackageMetaData error for [email protected]~1.0.3 request to https://registry.npmjs.org/escape-html failed, reason: read ECONNRESET
35 silly fetchPackageMetaData error for [email protected]~1.1.2 request to https://registry.npmjs.org/methods failed, reason: read ECONNRESET
36 silly fetchPackageMetaData error for [email protected] request to https://registry.npmjs.org/merge-descriptors failed, reason: read ECONNRESET
37 silly fetchPackageMetaData error for [email protected] request to https://registry.npmjs.org/serve-static failed, reason: read ECONNRESET
38 silly fetchPackageMetaData error for [email protected] request to https://registry.npmjs.org/qs failed, reason: read ECONNRESET
39 silly fetchPackageMetaData error for [email protected] request to https://registry.npmjs.org/utils-merge failed, reason: read ECONNRESET
40 silly fetchPackageMetaData error for [email protected]~1.2.0 request to https://registry.npmjs.org/range-parser failed, reason: read ECONNRESET
41 silly fetchPackageMetaData error for [email protected] request to https://registry.npmjs.org/setprototypeof failed, reason: read ECONNRESET
42 silly fetchPackageMetaData error for [email protected] request to https://registry.npmjs.org/safe-buffer failed, reason: read ECONNRESET
43 silly fetchPackageMetaData error for [email protected]~1.4.0 request to https://registry.npmjs.org/statuses failed, reason: read ECONNRESET
44 silly fetchPackageMetaData error for [email protected] request to https://registry.npmjs.org/send failed, reason: read ECONNRESET
45 silly fetchPackageMetaData error for type[email protected]~1.6.16 request to https://registry.npmjs.org/type-is failed, reason: read ECONNRESET
46 silly fetchPackageMetaData error for [email protected]~1.1.2 request to https://registry.npmjs.org/vary failed, reason: read ECONNRESET
47 timing stage:rollbackFailedOptional Completed in 2ms
48 timing stage:runTopLevelLifecycles Completed in 212059ms
49 silly saveTree [email protected]
49 silly saveTree `-- [email protected]
50 verbose type system
51 verbose stack FetchError: request to https://registry.npmjs.org/depd failed, reason: read ECONNRESET
51 verbose stack     at ClientRequest.req.on.err (C:\Program Files\nodejs\node_modules\npm\node_modules\node-fetch-npm\src\index.js:68:14)
51 verbose stack     at ClientRequest.emit (events.js:182:13)
51 verbose stack     at TLSSocket.socketErrorListener (_http_client.js:391:9)
51 verbose stack     at TLSSocket.emit (events.js:182:13)
51 verbose stack     at emitErrorNT (internal/streams/destroy.js:82:8)
51 verbose stack     at emitErrorAndCloseNT (internal/streams/destroy.js:50:3)
51 verbose stack     at process._tickCallback (internal/process/next_tick.js:63:19)
52 verbose cwd c:\node
53 verbose Windows_NT 10.0.14393
54 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "./express.tgz"
55 verbose node v10.13.0
56 verbose npm  v6.4.1
57 error code ECONNRESET
58 error errno ECONNRESET
59 error network request to https://registry.npmjs.org/depd failed, reason: read ECONNRESET
60 error network This is a problem related to network connectivity.
60 error network In most cases you are behind a proxy or have bad network settings.
60 error network
60 error network If you are behind a proxy, please make sure that the
60 error network 'proxy' config is set properly.  See: 'npm help config'
61 verbose exit [ 1, true ]

Answer the question

In order to leave comments, you need to log in

2 answer(s)
U
utyfua, 2018-11-29
@utyfua

You can simply put the contents of the archive correctly in the node_modules folder.
If the module is in place, it may not work for two reasons:
- there are no dependencies. You can again also carefully drag one by one, but it's muddy.
- the script was not executed when installing the package.
If you take the express, then there are 30 dependencies (clickable) . If the operating systems are the same, you can install the option from the comment - on a working machine and carefully transfer it.
It is also worth remembering that modules in dependencies can also be dependent on other modules.

D
Dmitry Makarov, 2018-11-29
@MDiMaI666

1. Extract the archive to node_modules
2. copy it to a USB flash drive or via FTP node_modules
if you want to put it in the package, then
npm init will create this file
Then put it there

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question