0

I want to use the Vue unit test utilities for Jest. This works fine on Windows, but I got an error on Linux.

This is what I did:

vue create my-project
  • Select Manually select features
  • Select Choose vue version
  • Deselect Babel
  • Select Typescript
  • Select Linter / Formatter
  • Select Unit Testing
  • Enter
  • Select 3.x (preview)
  • Answer 'y' to Class-style component syntax
  • Answer 'n' to Use Babel alongside ...
  • Pick a linter: Select ESLint + standard config
  • Pick additional lint features: Select Lint on save
  • Pick a unit testing solution: Select jest
  • Where do you prefer placing config: Select In package.json
  • Answer 'n' to Save this as a preset for future projects?

Then it attempts to create the project with the following output:

Vue CLI v4.5.10
✨  Creating project in /home/admiraal/my-project.
  Initializing git repository...
⚙️  Installing CLI plugins. This might take a while...

npm ERR! code 1
npm ERR! path /home/admiraal/my-project/node_modules/deasync
npm ERR! command failed
npm ERR! command sh -c node ./build.js
npm ERR! `linux-x64-node-15` exists; testing
npm ERR! Problem with the binary; manual build incoming
npm ERR! stdout=
npm ERR! err=Error: Command failed: /home/admiraal/.nvm/versions/node/v15.5.1/bin/node quick-test.js
npm ERR! /home/admiraal/my-project/node_modules/bindings/bindings.js:135
npm ERR!   throw err;
npm ERR!   ^
npm ERR!
npm ERR! Error: Could not locate the bindings file. Tried:
npm ERR!  → /home/admiraal/my-project/node_modules/deasync/build/deasync.node
npm ERR!  → /home/admiraal/my-project/node_modules/deasync/build/Debug/deasync.node
...
(many "npm ERR!" lines follow)

The same error appears when I try to add Jest to an existing successfully created project using

vue add unit-jest

Deinstalling and re-installing deasync does not solve the problem.

www.admiraalit.nl
  • 5,768
  • 1
  • 17
  • 32

1 Answers1

0

The solution is to downgrade node to version 12.0.0.

This question/answer helped me to find this solution.

To downgrade, perform the following steps:

nvm install 12.0.0
nvm alias default 12.0.0
nvm use default
www.admiraalit.nl
  • 5,768
  • 1
  • 17
  • 32