3forges / juste-un-curieux

Un site internet pour les curieux...
MIT License
0 stars 1 forks source link

svgo dependcy issue #4

Closed Jean-Baptiste-Lasselle closed 1 year ago

Jean-Baptiste-Lasselle commented 1 year ago
Utilisateur@Utilisateur-PC MINGW64 ~/juste-un-curieux (feature/spinup_project)
$ pnpm run  build

> justincurieux@0.0.1 build C:\Users\Utilisateur\juste-un-curieux
> astro build

23:53:07 [content] Types generated 1.14s
23:53:07 [build] output target: static
23:53:07 [build] Collecting build info...
23:53:07 [build] Completed in 1.37s.
23:53:07 [build] Building static entrypoints...
23:53:11 [build] Completed in 3.65s.

 building client
Completed in 98ms.

 generating static routes
▶ src/pages/index.astro
(node:10412) ExperimentalWarning: The Fetch API is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
file:///C:/Users/Utilisateur/juste-un-curieux/dist/chunks/pages/index.astro.f08d44cb.mjs:266
      throw new Error(`[astro-icon] Unable to load icon "${name}"!
            ^

Error: [astro-icon] Unable to load icon "wordmark"!
Error: Unknown builtin plugin "cleanupIDs" specified.
    at file:///C:/Users/Utilisateur/juste-un-curieux/dist/chunks/pages/index.astro.f08d44cb.mjs:266:13

Node.js v18.4.0
 ELIFECYCLE  Command failed with exit code 1.

Utilisateur@Utilisateur-PC MINGW64 ~/juste-un-curieux (feature/spinup_project)
$ ./node_modules/astro-icon/node_modules/.bin/svgo --version
node:internal/modules/cjs/loader:949
  throw err;
  ^

Error: Cannot find module 'C:\Users\Utilisateur\svgo@2.8.0\node_modules\svgo\bin\svgo'
    at Module._resolveFilename (node:internal/modules/cjs/loader:946:15)
    at Module._load (node:internal/modules/cjs/loader:787:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
    at node:internal/main/run_main_module:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

Node.js v18.4.0
Jean-Baptiste-Lasselle commented 1 year ago

So the fix is :

pnpm remove @types/svgo && pnpm remove svgo
# pnpm add -D @types/svgo@2.8.0 && pnpm add --save svgo@2.8.0
pnpm add -D @types/svgo && pnpm add --save svgo@2.8.0
Jean-Baptiste-Lasselle commented 1 year ago

"Et voilà!":

Utilisateur@Utilisateur-PC MINGW64 ~/juste-un-curieux (feature/spinup_project)
$ pnpm remove @types/svgo && pnpm remove svgo
pnpm add -D @types/svgo && pnpm add --save svgo@2.8.0
 ERR_PNPM_CANNOT_REMOVE_MISSING_DEPS  Cannot remove '@types/svgo': no such dependency found

Available dependencies: @astrojs/image, @astrojs/tailwind, @types/micromodal, astro, astro-icon, prettier, prettier-plugin-astro, prettier-plugin-tailwindcss, rimraf, tailwindcss-fluid-type, @fontsource-variable/inter, micromodal, sharp, tailwindcss, tiny-invariant

Utilisateur@Utilisateur-PC MINGW64 ~/juste-un-curieux (feature/spinup_project)
$ # pnpm add -D @types/svgo@2.8.0 && pnpm add --save svgo@2.8.0

Utilisateur@Utilisateur-PC MINGW64 ~/juste-un-curieux (feature/spinup_project)
$ pnpm add -D @types/svgo && pnpm add --save svgo@2.8.0
Progress: resolved 0, reused 1, downloaded 0, added 0
Progress: resolved 15, reused 15, downloaded 0, added 0
 WARN  deprecated @types/svgo@3.0.0: This is a stub types definition. svgo provides its own type definitions, so you do not need this installed.
Progress: resolved 147, reused 107, downloaded 0, added 0
 WARN  deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
Progress: resolved 772, reused 538, downloaded 0, added 0
Progress: resolved 773, reused 539, downloaded 0, added 0
Packages: +1
+
Progress: resolved 773, reused 539, downloaded 0, added 0, done

devDependencies:
+ @types/svgo 3.0.0 deprecated

Progress: resolved 1, reused 0, downloaded 0, added 0
 WARN  deprecated @types/svgo@3.0.0: This is a stub types definition. svgo provides its own type definitions, so you do not need this installed.
 WARN  deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
Progress: resolved 445, reused 339, downloaded 0, added 0
Progress: resolved 703, reused 529, downloaded 0, added 0
Progress: resolved 735, reused 536, downloaded 0, added 0
Progress: resolved 739, reused 539, downloaded 0, added 0
Already up-to-date
Progress: resolved 739, reused 539, downloaded 0, added 0, done

dependencies:
+ svgo 2.8.0 (3.0.2 is available)

Utilisateur@Utilisateur-PC MINGW64 ~/juste-un-curieux (feature/spinup_project)
$ pnpm run  build

> justincurieux@0.0.1 build C:\Users\Utilisateur\juste-un-curieux
> astro build

00:12:01 [content] Types generated 462ms
00:12:01 [build] output target: static
00:12:01 [build] Collecting build info...
00:12:01 [build] Completed in 672ms.
00:12:01 [build] Building static entrypoints...
00:12:04 [build] Completed in 3.22s.

 building client
Completed in 102ms.

 generating static routes
▶ src/pages/index.astro
(node:12612) ExperimentalWarning: The Fetch API is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
  └─ /index.html (+1.12s)
 optimizing 8 images in batches of 4
00:12:09 [build] Waiting for the @astrojs/image integration...
Completed in 4.78s.

Completed in 5.91s.

00:12:11 [build] 1 page(s) built in 9.93s
00:12:11 [build] Complete!