Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't install on windows using npx-create-directus-project #7707

Closed
3 tasks done
jaylinsell opened this issue Aug 30, 2021 · 4 comments
Closed
3 tasks done

Can't install on windows using npx-create-directus-project #7707

jaylinsell opened this issue Aug 30, 2021 · 4 comments

Comments

@jaylinsell
Copy link

jaylinsell commented Aug 30, 2021

Preflight Checklist

Describe the Bug

When trying to install Directus for the first time, the install fails due to what seems to be an argon package.

I've attached the end of the logs where the build fails:

12686 verbose stack Error: argon2@0.28.2 install: node-pre-gyp install --fallback-to-build
12686 verbose stack Exit status 1
12686 verbose stack at EventEmitter. (C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
12686 verbose stack at EventEmitter.emit (events.js:376:20)
12686 verbose stack at ChildProcess. (C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
12686 verbose stack at ChildProcess.emit (events.js:376:20)
12686 verbose stack at maybeClose (internal/child_process.js:1055:16)
12686 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
12687 verbose pkgid argon2@0.28.2
12688 verbose cwd D:\Clients\Dev Sites\directusdemo
12689 verbose Windows_NT 10.0.19042
12690 verbose argv "C:\Program Files (x86)\nodejs\node.exe" "C:\Program Files (x86)\nodejs\node_modules\npm\bin\npm-cli.js" "install" "directus" "--production" "--no-optional"
12691 verbose node v14.17.0
12692 verbose npm v6.14.13
12693 error code ELIFECYCLE
12694 error errno 1
12695 error argon2@0.28.2 install: node-pre-gyp install --fallback-to-build
12695 error Exit status 1
12696 error Failed at the argon2@0.28.2 install script.
12696 error This is probably not a problem with npm. There is likely additional logging output above.
12697 verbose exit [ 1, true ]

I'm on Windows, using Node 4.17.0.

Have tried the solutions for a similar issue logged where the install wouldn't work on Centos - but have had no luck.

To Reproduce

Run npx create-directus-project on windows.

What version of Directus are you using?

Latest

What version of Node.js are you using?

14.17.0

What database are you using?

Haven't got this far yet

What browser are you using?

Haven't got this far yet

What operating system are you using?

Windows 10

How are you deploying Directus?

Haven't got here yet.

@nickrum
Copy link
Member

nickrum commented Aug 30, 2021

It looks like you are running the 32 Bit version of Node. The argon2 package only provides binaries for 64 Bit systems, which means it will try to build those binaries for your platform. This requires additional tools to be installed. If your system actually supports 64 Bits, you could try installing the 64 Bit version of Node.

@rijkvanzanten
Copy link
Member

To run Directus, you currently need Node 12.20 or newer.

BTW, Node 4 has been end-of-life for years now, so I would highly recommend updating to a more recent version (16 is the current)

@jaylinsell
Copy link
Author

My bad, that was a typo - I was on Node V 14.17.0, not 4.17.0.

I've reinstalled Node for 64bit, have also re-installed all the windows build tools as described here for windows: https://github.com/nodejs/node-gyp.
I've now been able to 'install' directus, so to speak, but I'm now having issues choosing a database from the node prompt.

Steps:

  1. Run npx create-directus-project demo-proj
  2. Select Postgres for the database

This is now where the install fails.

? Choose your database client PostgreSQL / Redshift
⠙ Installing Database Driver...Error: Command failed with ENOENT: npm install pg --production
spawn cmd.exe ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:269:19)
at onErrorNT (internal/child_process.js:467:16)
at processTicksAndRejections (internal/process/task_queues.js:82:21) {
errno: -4058,
code: 'ENOENT',
syscall: 'spawn cmd.exe',
path: 'cmd.exe',
spawnargs: [
'/q',
'/d',
'/s',
'/c',
'"npm ^"install^" ^"pg^" ^"--production^""'
],
originalMessage: 'spawn cmd.exe ENOENT',
shortMessage: 'Command failed with ENOENT: npm install pg --production\n' +
'spawn cmd.exe ENOENT',
command: 'npm install pg --production',
escapedCommand: 'npm install pg --production',
exitCode: undefined,
signal: undefined,
signalDescription: undefined,
stdout: '',
stderr: '',
failed: true,
timedOut: false,
isCanceled: false,
killed: false
}
✖ Installing Directus
Error: undefined

@rijkvanzanten rijkvanzanten reopened this Aug 31, 2021
@rijkvanzanten
Copy link
Member

From a quick google, that messages span cmd.exe ENOENT seems to indicate that cmd isn't available in your PATH under WSL. I'm not a windows user myself, but it seems like this is most likely related to your specific way of running Node on your machine, and not an issue we can solve in the Directus tool necessarily. I'll transfer this to a Q&A discussion 👍🏻

@directus directus locked and limited conversation to collaborators Aug 31, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants