npm / cli

the package manager for JavaScript
https://docs.npmjs.com/cli/
Other
8.45k stars 3.14k forks source link

uhh, a bug i guess #3725

Closed ghost closed 3 years ago

ghost commented 3 years ago

some errors

~ $ npm install 16.9.0
npm WARN old lockfile
npm WARN old lockfile The package-lock.json file was created with an old version of npm,
npm WARN old lockfile so supplemental metadata must be fetched from the registry.
npm WARN old lockfile
npm WARN old lockfile This is a one-time fix-up, please be patient...
npm WARN old lockfile
npm ERR! Exit handler never called!

npm ERR! This is an error with npm itself. Please report this error at:
npm ERR!     <https://github.com/npm/cli/issues>

npm ERR! A complete log of this run can be found in:
npm ERR!     /data/data/com.termux/files/home/.npm/_logs/2021-09-08T10_03_47_120Z-debug.log

the output suggested me to some here and complain here, so i did ¯_(ツ)_/¯, very frustuated

ghost commented 3 years ago

my change logs

~ $ vim /data/data/com.termux/files/home/.npm/logs/2021-09-07T02_52_48_487Z-debug.log
0 info it worked if it ends with ok                             1 verbose cli [
1 verbose cli   '/data/data/com.termux/files/usr/bin/node',     1 verbose cli   '/data/data/com.termux/files/usr/bin/npm',      1 verbose cli   'install',                                      1 verbose cli   'discordjs'                                     1 verbose cli ]
2 info using npm@6.14.10
3 info using node@v14.15.4                                      4 verbose config Skipping project config: /data/data/com.termux/files/home/.npmrc. (matches userconfig)                         5 verbose npm-session ba564d80fa4a334b                          6 silly install loadCurrentTree
7 silly install readLocalPackageData                            8 http fetch GET 404 https://registry.npmjs.org/discordjs 1600ms9 http fetch GET 404 https://registry.npmjs.org/discordjs 1143ms
10 silly fetchPackageMetaData error for discordjs@latest 404 Not Found - GET https://registry.npmjs.org/discordjs - Not found   11 timing stage:rollbackFailedOptional Completed in 10ms
12 timing stage:runTopLevelLifecycles Completed in 3098ms       13 verbose stack Error: 404 Not Found - GET https://registry.npmjs.org/discordjs - Not found
13 verbose stack     at /data/data/com.termux/files/usr/lib/node
_modules/npm/node_modules/npm-registry-fetch/check-response.js:1
17:15                                                           13 verbose stack     at processTicksAndRejections (internal/process/task_queues.js:93:5)
14 verbose statusCode 404                                       15 verbose pkgid discordjs@latest                               16 verbose cwd /data/data/com.termux/files/home
17 verbose Linux 4.9.186-perf-g131f907
18 verbose argv "/data/data/com.termux/files/usr/bin/node" "/dat
a/data/com.termux/files/usr/bin/npm" "install" "discordjs"      19 verbose node v14.15.4
20 verbose npm  v6.14.10
21 error code E404
22 error 404 Not Found - GET https://registry.npmjs.org/discordjs - Not found
23 error 404                                                    24 error 404 'discordjs@latest' is not in the npm registry.     25 error 404 You should bug the author to publish it (or use the
 name yourself!)
26 error 404 Note that you can also install from a
27 error 404 tarball, folder, http url, or git url.
28 verbose exit [ 1, true ]
ljharb commented 3 years ago

There’s no package named 16.9.0, were you trying to nvm install 16.9.0?

ghost commented 3 years ago

There’s no package named 16.9.0, were you trying to nvm install 16.9.0?

yes, i was trying, but when i run npm install 16.9.0, it says, 16.9.0 is already installed

ljharb commented 3 years ago

n P m or n V m? they are different commands.

ghost commented 3 years ago

n P m or n V m? they are different commands.

both, side by side

ljharb commented 3 years ago

I’m confused. npm install 16.9.0 isn’t a command anyone would ever run, because there’s no package named “16.9.0”.

ghost commented 3 years ago

I’m confused. npm install 16.9.0 isn’t a command anyone would ever run, because there’s no package named “16.9.0”.

what should i run?

ljharb commented 3 years ago

If you’re trying to install node, nvm install 16.9.0 works fine. If you’re trying to install a package “foo”, npm install foo

ghost commented 3 years ago

node is not even runnig my discord bot js file

~ $ node hazy.js
HTTPError [ReferenceError]: AbortController is not defined
    at RequestHandler.execute (/data/data/com.termux/files/home/node_modules/discord.js/src/rest/RequestHandler.js:172:15)
    at RequestHandler.execute (/data/data/com.termux/files/home/node_modules/discord.js/src/rest/RequestHandler.js:176:19)
    at RequestHandler.push (/data/data/com.termux/files/home/node_modules/discord.js/src/rest/RequestHandler.js:50:25)
    at async WebSocketManager.connect (/data/data/com.termux/files/home/node_modules/discord.js/src/client/websocket/WebSocketManager.js:128:9)
    at async Client.login (/data/data/com.termux/files/home/node_modules/discord.js/src/client/Client.js:245:7) {
  code: 500,
  method: 'get',
  path: '/gateway/bot',
  requestData: { json: undefined, files: [] }
}
ghost commented 3 years ago
~ $ node hazy.js
(node:16578) UnhandledPromiseRejectionWarning: ReferenceError: AbortController is not defined
    at RequestHandler.execute (/data/data/com.termux/files/home/node_modules/discord.js/src/rest/RequestHandler.js:172:15)
    at RequestHandler.execute (/data/data/com.termux/files/home/node_modules/discord.js/src/rest/RequestHandler.js:176:19)
    at RequestHandler.push (/data/data/com.termux/files/home/node_modules/discord.js/src/rest/RequestHandler.js:50:25)
    at async WebSocketManager.connect (/data/data/com.termux/files/home/node_modules/discord.js/src/client/websocket/WebSocketManager.js:128:9)
    at async Client.login (/data/data/com.termux/files/home/node_modules/discord.js/src/client/Client.js:245:7)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:16578) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:16578) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
ghost commented 3 years ago

npm is not installing discord.js

~ $ npm install discordjs
npm WARN old lockfile
npm WARN old lockfile The package-lock.json file was created with an old version of npm,
npm WARN old lockfile so supplemental metadata must be fetched from the registry.
npm WARN old lockfile
npm WARN old lockfile This is a one-time fix-up, please be patient...
npm WARN old lockfile
npm ERR! Exit handler never called!

npm ERR! This is an error with npm itself. Please report this error at:
npm ERR!     <https://github.com/npm/cli/issues>

npm ERR! A complete log of this run can be found in:
npm ERR!     /data/data/com.termux/files/home/.npm/_logs/2021-09-09T02_05_47_491Z-debug.log
ghost commented 3 years ago

can you tell whats going on here?

$ npm install discord.js
npm WARN notsup Unsupported engine for discord.js@13.1.0: wanted: {"node":">=16.6.0","npm":">=7.0.0"} (current: {"node":"14.15.4","npm":"6.14.10"})
npm WARN notsup Not compatible with your version of node/npm: discord.js@13.1.0
npm WARN notsup Unsupported engine for @discordjs/builders@0.5.0: wanted: {"node":">=14.0.0","npm":">=7.0.0"} (current: {"node":"14.15.4","npm":"6.14.10"})
npm WARN notsup Not compatible with your version of node/npm: @discordjs/builders@0.5.0
npm WARN home@1.0.0 No description
npm WARN home@1.0.0 No repository field.

+ discord.js@13.1.0
updated 1 package and audited 25 packages in 7.447s
found 0 vulnerabilities
ljharb commented 3 years ago

What version of node are you using? AbortController is only in the most recent versions.

ghost commented 3 years ago
$ node -v
v14.15.4
ghost commented 3 years ago
$ npm install v16.6.0                             npm WARN old lockfile
npm WARN old lockfile The package-lock.json file was created with an old version of npm,
npm WARN old lockfile so supplemental metadata must be fetched from the registry.
npm WARN old lockfile
npm WARN old lockfile This is a one-time fix-up, please be patient...
npm WARN old lockfile
npm ERR! Exit handler never called!

npm ERR! This is an error with npm itself. Please report this error at:
npm ERR!     <https://github.com/npm/cli/issues>

npm ERR! A complete log of this run can be found in:
npm ERR!     /data/data/com.termux/files/home/.npm/_logs/2021-09-09T02_31_09_121Z-debug.log
ljharb commented 3 years ago

@nitin-ojha1 you keep typing that command, but it makes no sense. you want nvm install, not npm install, if you're going to supply a node version. note the V versus the P.

ghost commented 3 years ago

i dont want to install any kind of nvm, i want to make my discord js bot work, and yeah i already tried to install nvm and i successfully installed it by nvm guide, but still nothing happened

ljharb commented 3 years ago

Before you can use a JS project, you have to first be on the right node version. nvm is one of many ways to do that.

Don't try to invoke npm until you're on the right node version. The error in this comment: https://github.com/npm/cli/issues/3725#issuecomment-915707420 says that it requires node >= 16.6. So, get that installed first.

So far nothing in this is related to npm, so I'm going to close it.

ghost commented 3 years ago

i am suprised and sad that you couldnt actually help, but okay ☹️

ghost commented 3 years ago

seriously, npm is not installing anything

$ npm install git
npm WARN old lockfile
npm WARN old lockfile The package-lock.json file was created with an old version of npm,
npm WARN old lockfile so supplemental metadata must be fetched from the registry.
npm WARN old lockfile
npm WARN old lockfile This is a one-time fix-up, please be patient...
npm WARN old lockfile
npm ERR! Exit handler never called!

npm ERR! This is an error with npm itself. Please report this error at:
npm ERR!     <https://github.com/npm/cli/issues>

npm ERR! A complete log of this run can be found in:
npm ERR!     /data/data/com.termux/files/home/.npm/_logs/2021-09-09T10_38_11_435Z-debug.log
ghost commented 3 years ago

no matter what i want to install, error is always same

$ npm install vim
npm WARN old lockfile
npm WARN old lockfile The package-lock.json file was created with an old version of npm,
npm WARN old lockfile so supplemental metadata must be fetched from the registry.
npm WARN old lockfile
npm WARN old lockfile This is a one-time fix-up, please be patient...
npm WARN old lockfile
npm ERR! Exit handler never called!

npm ERR! This is an error with npm itself. Please report this error at:
npm ERR!     <https://github.com/npm/cli/issues>

npm ERR! A complete log of this run can be found in:
npm ERR!     /data/data/com.termux/files/home/.npm/_logs/2021-09-09T10_41_28_965Z-debug.log
ljharb commented 3 years ago

You can’t install git or vim from npm, they have to be installed separately.

Before you try to npm install something, try to find its package page on https://npmjs.com

ljharb commented 3 years ago

Don’t get me wrong; that error message seems like a bug, but until you can reproduce it with a package that actually exists I’m not sure what help can be provided.

ghost commented 3 years ago

i am on termux(android), in this case?