#npm warn deprecated - help..?

94 messages · Page 1 of 1 (latest)

haughty nest
#

new to js/ts,
im looking to import json that contains a png/pfp and an animated png, then exports as a gif.
tried this but getting errors importing.

npm i modern-gif      
npm warn deprecated [email protected]: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm warn deprecated [email protected]: This package is no longer supported.
npm warn deprecated [email protected]: Rimraf versions prior to v4 are no longer supported
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated [email protected]: This package is no longer supported.
npm warn deprecated [email protected]: This package is no longer supported.
npm warn cleanup Failed to remove some directories [
npm warn cleanup   [
npm warn cleanup     'C:\\Coding\\Python X Web Dev\\node_modules\\canvas',
npm warn cleanup     [Error: EPERM: operation not permitted, rmdir 'C:\Coding\Python X Web Dev\node_modules\canvas\build\Release\obj\canvas\canvas.tlog'] {
npm warn cleanup       errno: -4048,
npm warn cleanup       code: 'EPERM',
npm warn cleanup       syscall: 'rmdir',
npm warn cleanup       path: 'C:\\Coding\\Python X Web Dev\\node_modules\\canvas\\build\\Release\\obj\\canvas\\canvas.tlog'
npm warn cleanup     }
npm warn cleanup   ]
npm warn cleanup ]
#

the goal is to make gifs using web canvases.
and since apngs arent as common still, i wasnt sure how to proceed since it has 8px transparency, but contains several frames of pngs.

supple rune
#

Are you positive you don't want APNGs? They're not common but still supported by every browser

haughty nest
weary hinge
#

what version of node do you have installed? modern-gif installs just fine for me

haughty nest
#

10.8.2?

weary hinge
#

LOL that's crazy old

haughty nest
#

rlly?

#

oops

supple rune
#

Install node v24

cobalt depot
#

did you do npm --version or node --version?

haughty nest
#

npm --version

supple rune
#

Ah, that's npm, a package manager for the node.js environment

haughty nest
#

v22.6.0 for node

supple rune
#

(think python and pip)

haughty nest
#

ok

supple rune
#

Did you install node.js with build tools?

#

I see the warn is from canvas

haughty nest
#

i installed it w/ christitus's manager. it's how i installed everything when i reset my pc last year.

#

iwr -useb https://christitus.com/win | iex

#

via powershell

supple rune
#

Valid

#

I think it takes it from chocolatey. I do not know the flags from chocolatey

haughty nest
#

yeah it does.

cobalt depot
#

(a bit beside the point, but I'd like to point out the Node wrapper around the discord API (discord.js) is far superior to the Python one. So just in case you'd consider going full JavaScript)

haughty nest
#

erither chocolatey or winget

haughty nest
#

c# is for streamerbot and ts was for static welcome pages.

#

sooo... is npm outdated?

weary hinge
#

no

supple rune
#

No no it's fine

haughty nest
#

then how do i fix the error im getting when installing modern-gif ?

weary hinge
#

modern-gif installed for me with both node 20.x and 22.x...

supple rune
#

@weary hinge do you have the build tools installed?

weary hinge
#

yes. didn't look like it built anything, though

haughty nest
#

reinstall node/npm i'm guessing?

supple rune
#

I'm never calm when canvas is involved 😛

weary hinge
#

modern-gif doesn't even have a dependency on canvas

supple rune
#
npm warn cleanup Failed to remove some directories [
npm warn cleanup   [
npm warn cleanup     'C:\\Coding\\Python X Web Dev\\node_modules\\canvas',

Then this warning comes from another package of the project?

weary hinge
#

guess so. modern-gif only depends on modern-palette, which has no deps

supple rune
#

Fair enough. What are your other deps?

haughty nest
#
chocolatey-dotnetfx.extension not installed. An error occurred during installation:
 Unable to obtain lock file access on 'C:\ProgramData\chocolatey\lib\84b2b79887c621c4fdea3d797465afdb8621b29e' for operations on 'C:\ProgramData\chocolatey\lib\chocolatey-dotnetfx.extension'. This may mean that a different user or administrator is holding this lock and that this process does not have permission to access it. If no other process is currently performing an operation on this file it may mean that an earlier NuGet process crashed and left an inaccessible lock file, in this case removing the file 'C:\ProgramData\chocolatey\lib\84b2b79887c621c4fdea3d797465afdb8621b29e' will allow NuGet to continue.
chocolatey-dotnetfx.extension package files install failed with exit code 1. Performing other installation steps.
The install of chocolatey-dotnetfx.extension was NOT successful.
chocolatey-dotnetfx.extension not installed. An error occurred during installation:
 Unable to obtain lock file access on 'C:\ProgramData\chocolatey\lib\84b2b79887c621c4fdea3d797465afdb8621b29e' for operations on 'C:\ProgramData\chocolatey\lib\chocolatey-dotnetfx.extension'. This may mean that a different user or administrator is holding this lock and that this process does not have permission to access it. If no other process is currently performing an operation on this file it may mean that an earlier NuGet process crashed and left an inaccessible lock file, in this case removing the file 'C:\ProgramData\chocolatey\lib\84b2b79887c621c4fdea3d797465afdb8621b29e' will allow NuGet to continue.
#

Chocolatey installed 0/0 packages.

weary hinge
#

if you aren't running chocolatey somewhere else, delete the lock file

haughty nest
#

inaccessible lock file

weary hinge
#

reboot.. try again.. use the MSI installer..

haughty nest
#

does this use microsoft store?

weary hinge
#

no...

supple rune
#

MSI is a file extension for MicroSoft Installer, it's not about the MS Store

weary hinge
#

again, modern-gif has no dependencies... so, something else you're using is causing problems and reinstalling might not make a difference. as P35 asked, what are your other dependencies?

haughty nest
#

most things i've built from scratch, no packages really. just basic node.

weary hinge
#

no packages, except a shitload of them...

#

having the fs package installed is a big red flag

haughty nest
weary hinge
#

it is not a valid package. fs is built-in to node... you really shouldn't have a bunch of these installed...

haughty nest
#

installed chocolatey via msi package.
Chocolatey installed 0/0 packages. same inaccessible lock error.

weary hinge
#

I did not mean to reinstall chocolatey....

#

reinstall Node.js

haughty nest
#

oh

weary hinge
#

when it asks, check the box to install build tools

#

your project is fucked though... fix your dependencies

haughty nest
#
 The upgrade of visualstudio2022-workload-nodebuildtools was successful.
  Software install location not explicitly set, it could be in package or
  default install location of installer.

lets see if this solves the issue.

haughty nest
#

is that why the packages installed?

supple rune
#

The packages installed are in package.json

#

tsconfig.json is a TS-specific thing, not node/npm

haughty nest
# supple rune The packages installed are in `package.json`
{
  "name": "your-project-name",
  "version": "1.0.0",
  "description": "",
  "main": "dist/generate_gif.js",
  "scripts": {
    "build": "tsc"
  },
  "author": "",
  "license": "",
  "devDependencies": {
    "@types/node": "^20.0.0",
    "typescript": "^5.0.0"
  },
  "dependencies": {
  }
}

just a basic config no?

weary hinge
#

if it were the correct package.json, it would include modern-gif

haughty nest
#

would i have to input the packages i wanna use like a requirements.txt or does npm automatically do that?

weary hinge
#

wat

#

npm install package adds the package to package.json (and installs it)

haughty nest
#

python - pip has requirements.txt i have to list every package/lib i wanna use, or setup a routine the project updates it.

so then why wasn't the packages in there? o.o like i said i use bare-bones js. i didnt install them. unless it's from the tsconfig

cobalt depot
#

the empty dependencies section is where you'd have the modern-gif dependency. pip install -r requirements is the equivalent to npm i (without further arguments). The latter automatically looks for a package.json to install everything located in dependencies (and devDependencies, for that matter). Doing npm i X is the same as adding X to your requirements.txt in Python

haughty nest
#

ah

cobalt depot
#

npm installation is always done locally in the (ephemeral) node_modules directory

weary hinge
#

change to the directory where package.json is present and run npm install modern-gif

#

where on earth were you when you ran npm ls before?? again, that doesn't match this package.json...

haughty nest
#

in the same directory...

weary hinge
#

/doubt

haughty nest
#

55 packages removed.

#

i was in the same directory.

weary hinge
#

ya, it removed everything that shouldn't have been there. you obviously changed something...

#

cool, so now modern-gif is installed. enjoy

haughty nest
#

only thing i changed was "esModuleInterop": false,

weary hinge
#

looks like you still incorrectly have puppeteer and tootallnate installed

#

npx rimraf node_modules && npm i

haughty nest
#

the folders were empty, i guess it just didn't delete them?

soo for gifs i use modern-gif, is there something else i should use instead of canvas for exporting as a gif file?

#

if i'm adding a png and an apng?