Node.js ekosystem mám rád. Celkově Javascript je můj druhý nejsilnější jazyk. Když něco nechci psát v PHP, tak sáhnu po JS. Když do toho započítám Typescript, tak bomba.
Víte, že Node.js od verze 23.6+ podporuje nativně Typescript?
Na OSX se mi stala chyba, která se mi sem tam opakuje a vždycky zapomenu o co jde. V hlavních rolích je tu SASS a modul distutils.
SASS již na nových projektech nepoužívám, šel jsem do Tailwindu a tak nějak není cesty zpět.
Znáte TailwindUI? Umí to dost šetřit čas.
pnpm install --frozen-lockfile
Lockfile is up to date, resolution step is skipped
Packages: +507 -8
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---
Progress: resolved 507, reused 197, downloaded 310, added 417, done
node_modules/.pnpm/[email protected]/node_modules/es5-ext: Running postinstall script, done in 65ms
node_modules/.pnpm/[email protected]/node_modules/esbuild: Running postinstall script, done in 310ms
node_modules/.pnpm/[email protected]/node_modules/node-sass: Running install script, done in 677ms
node_modules/.pnpm/[email protected]/node_modules/yarn: Running preinstall script, done in 41ms
node_modules/.pnpm/[email protected]/node_modules/node-sass: Running postinstall script, failed in 659ms
.../node_modules/node-sass postinstall$ node scripts/build.js
│ Building: /opt/homebrew/Cellar/node@18/18.20.5/bin/node /opt/myapp/node_modules/.pnpm/[email protected]…
│ gyp info it worked if it ends with ok
│ gyp verb cli [
│ gyp verb cli '/opt/homebrew/Cellar/node@18/18.20.5/bin/node',
│ gyp verb cli '/opt/myapp/node_modules/.pnpm/[email protected]/node_modules/node-gyp/bin/node-gyp.js…
│ gyp verb cli 'rebuild',
│ gyp verb cli '--verbose',
│ gyp verb cli '--libsass_ext=',
│ gyp verb cli '--libsass_cflags=',
│ gyp verb cli '--libsass_ldflags=',
│ gyp verb cli '--libsass_library='
│ gyp verb cli ]
│ gyp info using [email protected]
│ gyp info using [email protected] | darwin | arm64
│ gyp verb command rebuild []
│ gyp verb command clean []
│ gyp verb clean removing "build" directory
│ gyp verb command configure []
│ Traceback (most recent call last):
│ File "/opt/myapp/node_modules/.pnpm/[email protected]/node_modules/node-gyp/gyp/gyp_main.py", line …
│ import gyp # noqa: E402
│ ^^^^^^^^^^
│ File "/opt/myapp/node_modules/.pnpm/[email protected]/node_modules/node-gyp/gyp/pylib/gyp/__init__.…
│ import gyp.input
│ File "/opt/myapp/node_modules/.pnpm/[email protected]/node_modules/node-gyp/gyp/pylib/gyp/input.py"…
│ from distutils.version import StrictVersion
│ ModuleNotFoundError: No module named 'distutils'
│ gyp ERR! configure error
│ gyp ERR! stack Error: `gyp` failed with exit code: 1
│ gyp ERR! stack at ChildProcess.onCpExit (/opt/myapp/node_modules/.pnpm/[email protected]/node_mod…
│ gyp ERR! stack at ChildProcess.emit (node:events:517:28)
│ gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:292:12)
│ gyp ERR! System Darwin 24.2.0
│ gyp ERR! command "/opt/homebrew/Cellar/node@18/18.20.5/bin/node" "/opt/myapp/node_modules/.pnpm/no…
│ gyp ERR! cwd /opt/myapp/node_modules/.pnpm/[email protected]/node_modules/node-sass
│ gyp ERR! node -v v18.20.5
│ gyp ERR! node-gyp -v v8.4.1
│ gyp ERR! not ok
│ Build failed with error code: 1
└─ Failed in 660ms at /opt/myapp/node_modules/.pnpm/[email protected]/node_modules/node-sass
ELIFECYCLE Command failed with exit code 1.
Co s tím? Naštěstí stačí doinstalovat jeden balíček.
OSX
brew install python-setuptools
Linux
python3 -m pip install setuptools