2

I'm working through the faust.js documentation to create a headless WordPress site with Next.js. I can't get past step two: https://faustjs.org/docs/tutorial/learn-faust/#2-set-up-headless-wordpress-backend

When I run npm run wp-dev in the fresh install, I get the following error (full error below):

Error: Could not create directory "/var/www/html/wp-content/B&ce<%#Yl&k0-&2&=BKkTuOo,U%me@Uj$0U&": Invalid argument.

I've tried using npm versions 22, 21, 18, and 16. How can I troubleshoot this error?

NPM 21.4.0
Windows 11

Full error:

$ npm run wp-dev

> [email protected] wp-dev
> npx @wp-now/wp-now start --blueprint faust-tutorial-blueprint.json

Starting the server......
directory: C:\Users\jill\projects\faust-tutorial
mode: playground
php: 8.0
wp: 6.8.3 (resolved from alias: latest)
WordPress 6.8.3 folder already exists. Skipping download.
SQLite folder already exists. Skipping download.
blueprint steps: 1
Error: Could not create directory "/var/www/html/wp-content/B&ce<%#Yl&k0-&2&=BKkTuOo,U%me@Uj$0U&": Invalid argument.
    at descriptor.value (C:\Users\jill\AppData\Local\npm-cache\_npx\7c65af5c66ec2a7e\node_modules\@php-wasm\node\index.cjs:72685:17)
    at installAsset (file:///C:/Users/jill/AppData/Local/npm-cache/_npx/7c65af5c66ec2a7e/node_modules/@wp-playground/blueprints/index.js:1106:15)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Object.installPlugin (file:///C:/Users/jill/AppData/Local/npm-cache/_npx/7c65af5c66ec2a7e/node_modules/@wp-playground/blueprints/index.js:1157:34)
    at async o (file:///C:/Users/jill/AppData/Local/npm-cache/_npx/7c65af5c66ec2a7e/node_modules/@wp-playground/blueprints/index.js:9440:30)
    at async Object.run (file:///C:/Users/jill/AppData/Local/npm-cache/_npx/7c65af5c66ec2a7e/node_modules/@wp-playground/blueprints/index.js:9367:23)
    at async runBlueprintSteps (file:///C:/Users/jill/AppData/Local/npm-cache/_npx/7c65af5c66ec2a7e/node_modules/@wp-playground/blueprints/index.js:9475:3)
    at async startWPNow (file:///C:/Users/jill/AppData/Local/npm-cache/_npx/7c65af5c66ec2a7e/node_modules/@wp-now/wp-now/main.js:739:5)
    at async startServer (file:///C:/Users/jill/AppData/Local/npm-cache/_npx/7c65af5c66ec2a7e/node_modules/@wp-now/wp-now/main.js:1003:42)
    at async Object.handler (file:///C:/Users/jill/AppData/Local/npm-cache/_npx/7c65af5c66ec2a7e/node_modules/@wp-now/wp-now/main.js:1184:25) {
  [cause]: [<generic error, no stack>] {
    name: 'ErrnoError',
    node: undefined,
    setErrno: [Function (anonymous)],
    errno: 28,
    message: 'FS error'
  }
}
Error: Error when executing the blueprint step #0 ({"step":"installPlugin","pluginZipFile":{"resource":"wordpress.org/plugins","slug":"wp-graphql"}}) : Could not create directory "/var/www/html/wp-content/B&ce<%#Yl&k0-&2&=BKkTuOo,U%me@Uj$0U&": Invalid argument.
    at Object.run (file:///C:/Users/jill/AppData/Local/npm-cache/_npx/7c65af5c66ec2a7e/node_modules/@wp-playground/blueprints/index.js:9370:37)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async runBlueprintSteps (file:///C:/Users/jill/AppData/Local/npm-cache/_npx/7c65af5c66ec2a7e/node_modules/@wp-playground/blueprints/index.js:9475:3)
    ... 2 lines matching cause stack trace ...
    at async Object.handler (file:///C:/Users/jill/AppData/Local/npm-cache/_npx/7c65af5c66ec2a7e/node_modules/@wp-now/wp-now/main.js:1184:25) {
  [cause]: Error: Could not create directory "/var/www/html/wp-content/B&ce<%#Yl&k0-&2&=BKkTuOo,U%me@Uj$0U&": Invalid argument.
      at descriptor.value (C:\Users\jill\AppData\Local\npm-cache\_npx\7c65af5c66ec2a7e\node_modules\@php-wasm\node\index.cjs:72685:17)
      at installAsset (file:///C:/Users/jill/AppData/Local/npm-cache/_npx/7c65af5c66ec2a7e/node_modules/@wp-playground/blueprints/index.js:1106:15)
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
      at async Object.installPlugin (file:///C:/Users/jill/AppData/Local/npm-cache/_npx/7c65af5c66ec2a7e/node_modules/@wp-playground/blueprints/index.js:1157:34)
      at async o (file:///C:/Users/jill/AppData/Local/npm-cache/_npx/7c65af5c66ec2a7e/node_modules/@wp-playground/blueprints/index.js:9440:30)
      at async Object.run (file:///C:/Users/jill/AppData/Local/npm-cache/_npx/7c65af5c66ec2a7e/node_modules/@wp-playground/blueprints/index.js:9367:23)
      at async runBlueprintSteps (file:///C:/Users/jill/AppData/Local/npm-cache/_npx/7c65af5c66ec2a7e/node_modules/@wp-playground/blueprints/index.js:9475:3)
      at async startWPNow (file:///C:/Users/jill/AppData/Local/npm-cache/_npx/7c65af5c66ec2a7e/node_modules/@wp-now/wp-now/main.js:739:5)
      at async startServer (file:///C:/Users/jill/AppData/Local/npm-cache/_npx/7c65af5c66ec2a7e/node_modules/@wp-now/wp-now/main.js:1003:42)
      at async Object.handler (file:///C:/Users/jill/AppData/Local/npm-cache/_npx/7c65af5c66ec2a7e/node_modules/@wp-now/wp-now/main.js:1184:25) {
    [cause]: [<generic error, no stack>] {
      name: 'ErrnoError',
      node: undefined,
      setErrno: [Function (anonymous)],
      errno: 28,
      message: 'FS error'
    }
  }
}
Failed to start the server: Error when executing the blueprint step #0 ({"step":"installPlugin","pluginZipFile":{"resource":"wordpress.org/plugins","slug":"wp-graphql"}}) : Could not create directory "/var/www/html/wp-content/B&ce<%#Yl&k0-&2&=BKkTuOo,U%me@Uj$0U&": Invalid argument.

 
4
  • I'm one of the maintainers of Faust.js. I couldn't replicate this on Mac, but based on the Windows context, the use of npm degit might be running into permission issues. As a first step to try and get the Faust tutorial to work could you try: sh git clone [email protected]:wpengine/faustjs.git && cd faustjs/examples/next/tutorial && nvm use && npm install && npm run wp-dev Please let us know if this resolves the issue for you. Commented Nov 6 at 18:18
  • @ColinMurphy thanks for maintaining Faust! Our team is excited to use it (just testing it out first). I'm almost positive it's a Windows issues. I tried the command you provided above (although removed sh from the beginning, and added a version number after nvm use because my system requires it. Seeing the same error unfortunately. Commented Nov 6 at 22:37
  • Great to hear that you are testing out Faust and sorry that didn't work for you. Looking at the error again, it looks like the error is due to wp-now and wpgraphql and downloading the plugin. executing...` If you comment out the plugins and install them manually install them through the WordPress plugin manager would that work? If you can comment the following lines in the faust-tutorial-blueprint.json file: ``` "plugins": ["wp-graphql", "faustwp"], ``` And then run npm wp-now to see if that works. If none of this works, let us know and we see what the next steps are. Commented Nov 7 at 16:09
  • Another idea would be to try and install the latest wp-now e.g. npm install @wp-now/wp-now@latest and then run npm run wp-dev to see if that works. Commented Nov 7 at 16:10

3 Answers 3

1

Thank you @ColinMurphy for commenting the answer above. Removing line 13 from faust-tutorial-blueprint.json fixed the issue. Once that line was removed, I was able to npm run wp-dev and install those plugins through the wordpress UI.

I believe this was a Windows 11 problem, but have not confirmed one way or the other.

Sign up to request clarification or add additional context in comments.

Comments

1

Thanks @Jillian Hoenig for confirming this was resolved.

We have added an issue to our sprint to rewrite the Faust tutorial to use wp-env instead of wp-now - https://github.com/wpengine/faustjs/issues/2211

We feel this might be more reliable going forward for all systems. Additionally this is something we have used recently in our hwptoolkit examples.

I can let you know once this is implemented.

1 Comment

Awesome! Thanks for all your help!
0

@Jillian Hoenig

We have now fixed the tutorial to use wp-env instead of wp-now - https://faustjs.org/docs/tutorial/learn-faust/

Thank you so much for letting us know about the issues you were having and hopefully this will fix any issues.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.