directus / directus

The flexible backend for all your projects 🐰 Turn your DB into a headless CMS, admin panels, or apps with a custom UI, instant APIs, auth & more.
https://directus.io
Other
28.06k stars 3.91k forks source link

impossible to install v10.8.2 on local computer #20821

Closed Pachat closed 10 months ago

Pachat commented 10 months ago

Describe the Bug

When running npm init directus-project directustest with node -v v21.4.0 and npm -v 10.2.5 installation stops with the following messages

×     Installing Directus
npm WARN deprecated @types/cssnano@5.1.0: This is a stub types definition. cssnano provides its own type definitions, so you do not need this installed.
npm WARN deprecated @npmcli/move-file@1.1.2: This functionality has been moved to @npmcli/fs
npm 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
npm WARN deprecated consolidate@0.15.1: Please upgrade to consolidate v1.0.0+ as it has been modernized with several long-awaited fixes implemented. Maintenance is supported by Forward Email at https://forwardemail.net ; follow/watch https://github.com/ladjs/consolidate for updates and release changelog
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated json2csv@5.0.7: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
npm WARN deprecated @azure/msal-browser@2.38.3: A newer major version of this library is available. Please upgrade to the latest available version.
npm WARN cleanup Failed to remove some directories [
npm WARN cleanup   [
npm WARN cleanup     'C:\\Direcv10.8.2\\directustest\\node_modules\\sharp',
npm WARN cleanup     [Error: EBUSY: resource busy or locked, rmdir 'C:\Direcv10.8.2\directustest\node_modules\sharp'] {
npm WARN cleanup       errno: -4082,
npm WARN cleanup       code: 'EBUSY',
npm WARN cleanup       syscall: 'rmdir',
npm WARN cleanup       path: 'C:\\Direcv10.8.2\\directustest\\node_modules\\sharp'
npm WARN cleanup     }
npm WARN cleanup   ],
npm WARN cleanup   [
npm WARN cleanup     'C:\\Direcv10.8.2\\directustest\\node_modules',
npm WARN cleanup     [Error: EBUSY: resource busy or locked, rmdir 'C:\Direcv10.8.2\directustest\node_modules\sharp'] {
npm WARN cleanup       errno: -4082,
npm WARN cleanup       code: 'EBUSY',
npm WARN cleanup       syscall: 'rmdir',
npm WARN cleanup       path: 'C:\\Direcv10.8.2\\directustest\\node_modules\\sharp'
npm WARN cleanup     }
npm WARN cleanup   ],
npm WARN cleanup   [
npm WARN cleanup     'C:\\Direcv10.8.2\\directustest\\node_modules\\@azure\\core-client',
npm WARN cleanup     [Error: EPERM: operation not permitted, rmdir 'C:\Direcv10.8.2\directustest\node_modules\@azure\core-client\node_modules\@azure\core-tracing'] {
npm WARN cleanup       errno: -4048,
npm WARN cleanup       code: 'EPERM',
npm WARN cleanup       syscall: 'rmdir',
npm WARN cleanup       path: 'C:\\Direcv10.8.2\\directustest\\node_modules\\@azure\\core-client\\node_modules\\@azure\\core-tracing'
npm WARN cleanup     }
npm WARN cleanup   ],
npm WARN cleanup   [
npm WARN cleanup     'C:\\Direcv10.8.2\\directustest\\node_modules\\@azure\\keyvault-keys',
npm WARN cleanup     [Error: EPERM: operation not permitted, rmdir 'C:\Direcv10.8.2\directustest\node_modules\@azure\keyvault-keys\node_modules\@azure'] {
npm WARN cleanup       errno: -4048,
npm WARN cleanup       code: 'EPERM',
npm WARN cleanup       syscall: 'rmdir',
npm WARN cleanup       path: 'C:\\Direcv10.8.2\\directustest\\node_modules\\@azure\\keyvault-keys\\node_modules\\@azure'
npm WARN cleanup     }
npm WARN cleanup   ],
npm WARN cleanup   [
npm WARN cleanup     'C:\\Direcv10.8.2\\directustest\\node_modules\\@azure\\storage-blob',
npm WARN cleanup     [Error: EPERM: operation not permitted, rmdir 'C:\Direcv10.8.2\directustest\node_modules\@azure\storage-blob\dist-esm\storage-blob'] {
npm WARN cleanup       errno: -4048,
npm WARN cleanup       code: 'EPERM',
npm WARN cleanup       syscall: 'rmdir',
npm WARN cleanup       path: 'C:\\Direcv10.8.2\\directustest\\node_modules\\@azure\\storage-blob\\dist-esm\\storage-blob'
npm WARN cleanup     }
npm WARN cleanup   ],
npm WARN cleanup   [
npm WARN cleanup     'C:\\Direcv10.8.2\\directustest\\node_modules\\@azure\\msal-browser',
npm WARN cleanup     [Error: EPERM: operation not permitted, rmdir 'C:\Direcv10.8.2\directustest\node_modules\@azure\msal-browser\node_modules'] {
npm WARN cleanup       errno: -4048,
npm WARN cleanup       code: 'EPERM',
npm WARN cleanup       syscall: 'rmdir',
npm WARN cleanup       path: 'C:\\Direcv10.8.2\\directustest\\node_modules\\@azure\\msal-browser\\node_modules'
npm WARN cleanup     }
npm WARN cleanup   ]
npm WARN cleanup ]
npm ERR! code 1
npm ERR! path C:\Direcv10.8.2\directustest\node_modules\isolated-vm
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c prebuild-install || (node-gyp rebuild --release -j 4 && node-gyp clean)
npm ERR! prebuild-install warn install No prebuilt binaries found (target=21.4.0 runtime=node arch=x64 libc= platform=win32)
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@8.4.1
npm ERR! gyp info using node@21.4.0 | win32 | x64
npm ERR! gyp info find Python using Python version 3.12.1 found at "C:\Python312\python.exe"
npm ERR! gyp info find VS using VS2019 (16.11.34301.259) found at:
npm ERR! gyp info find VS "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools"
npm ERR! gyp info find VS run with --verbose for detailed information
npm ERR! gyp info spawn C:\Python312\python.exe
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   'C:\\Direcv10.8.2\\directustest\\node_modules\\node-gyp\\gyp\\gyp_main.py',
npm ERR! gyp info spawn args   'binding.gyp',
npm ERR! gyp info spawn args   '-f',
npm ERR! gyp info spawn args   'msvs',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   'C:\\Direcv10.8.2\\directustest\\node_modules\\isolated-vm\\build\\config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   'C:\\Direcv10.8.2\\directustest\\node_modules\\node-gyp\\addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   'C:\\Users\\hcesb\\AppData\\Local\\node-gyp\\Cache\\21.4.0\\include\\node\\common.gypi',
npm ERR! gyp info spawn args   '-Dlibrary=shared_library',
npm ERR! gyp info spawn args   '-Dvisibility=default',
npm ERR! gyp info spawn args   '-Dnode_root_dir=C:\\Users\\hcesb\\AppData\\Local\\node-gyp\\Cache\\21.4.0',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=C:\\Direcv10.8.2\\directustest\\node_modules\\node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=C:\\\\Users\\\\hcesb\\\\AppData\\\\Local\\\\node-gyp\\\\Cache\\\\21.4.0\\\\<(target_arch)\\\\node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=C:\\Direcv10.8.2\\directustest\\node_modules\\isolated-vm',
npm ERR! gyp info spawn args   '-Dnode_engine=v8',
npm ERR! gyp info spawn args   '--depth=.',
npm ERR! gyp info spawn args   '--no-parallel',
npm ERR! gyp info spawn args   '--generator-output',
npm ERR! gyp info spawn args   'C:\\Direcv10.8.2\\directustest\\node_modules\\isolated-vm\\build',
npm ERR! gyp info spawn args   '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! Traceback (most recent call last):
npm ERR!   File "C:\Direcv10.8.2\directustest\node_modules\node-gyp\gyp\gyp_main.py", line 42, in <module>
npm ERR!     import gyp  # noqa: E402
npm ERR!     ^^^^^^^^^^
npm ERR!   File "C:\Direcv10.8.2\directustest\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 9, in <module>
npm ERR!     import gyp.input
npm ERR!   File "C:\Direcv10.8.2\directustest\node_modules\node-gyp\gyp\pylib\gyp\input.py", line 19, in <module>
npm ERR!     from distutils.version import StrictVersion
npm ERR! ModuleNotFoundError: No module named 'distutils'
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: `gyp` failed with exit code: 1
npm ERR! gyp ERR! stack     at ChildProcess.onCpExit (C:\Direcv10.8.2\directustest\node_modules\node-gyp\lib\configure.js:259:16)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:519:28)
npm ERR! gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:294:12)
npm ERR! gyp ERR! System Windows_NT 10.0.22621
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Direcv10.8.2\\directustest\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--release" "-j" "4"
npm ERR! gyp ERR! cwd C:\Direcv10.8.2\directustest\node_modules\isolated-vm
npm ERR! gyp ERR! node -v v21.4.0
npm ERR! gyp ERR! node-gyp -v v8.4.1
npm ERR! gyp ERR! not ok

To Reproduce

On an empty C:newdir type command npm init directus-project directustest

Directus Version

v10.8.2

Hosting Strategy

Self-Hosted (Custom)

br41nslug commented 10 months ago

Closing this for now as it looks like you're running an unsupported nodejs version.

npm ERR! gyp ERR! node -v v21.4.0

https://docs.directus.io/self-hosted/cli.html#requirements

Pachat commented 10 months ago

@br41nslug My fault. I mistakenly thought Node v18 meant at least v18. Works perfectly with v18.19.0 THANKS