question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Please remove dependency on deasync

See original GitHub issue

Out of nowhere, since trying out Node 16 and Node 17, npm install fails because of deasync.

I can see that deasync is a dependency of vue-jest:

frontend@0.1.0 /mnt/c/Users/Lloyd/source/repos/website/frontend
└─┬ @vue/cli-plugin-unit-jest@4.5.14
  └─┬ vue-jest@3.0.7
    └── deasync@0.1.23

The reason for this issue is that for whatever reason the deasync library has dependencies on some nasty Python and Node GYP stuff. Why this is only a problem now with Node 16 and Node 17 I don’t know, but it’s starting to cause a big problem for Vue CLI users upgrading to the current version of Node. We are stuck on Node 14 LTS.

Given the LTS will eventually be deprecated, every user of Vue CLI/vue-jest is going to encounter this problem soon.

I am sure I’m not alone in thinking it’s pretty ridiculous needing Python installed purely for the sake of that poorly maintained library. Especially if a developer has no other need of Python.

npm ERR! code 1
npm ERR! path C:\Users\Lloyd\source\repos\website\frontend\node_modules\deasync
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node ./build.js
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@7.1.2
npm ERR! gyp info using node@17.0.0 | win32 | x64
npm ERR! gyp ERR! find Python
npm ERR! gyp ERR! find Python Python is not set from command line or npm configuration
npm ERR! gyp ERR! find Python Python is not set from environment variable PYTHON
npm ERR! gyp ERR! find Python checking if "python3" can be used
npm ERR! gyp ERR! find Python - "python3" is not in PATH or produced an error
npm ERR! gyp ERR! find Python checking if "python" can be used
npm ERR! gyp ERR! find Python - "python" is not in PATH or produced an error
npm ERR! gyp ERR! find Python checking if "python2" can be used
npm ERR! gyp ERR! find Python - "python2" is not in PATH or produced an error
npm ERR! gyp ERR! find Python checking if Python is C:\Python37\python.exe
npm ERR! gyp ERR! find Python - "C:\Python37\python.exe" could not be run
npm ERR! gyp ERR! find Python checking if Python is C:\Python27\python.exe
npm ERR! gyp ERR! find Python - "C:\Python27\python.exe" could not be run
npm ERR! gyp ERR! find Python checking if the py launcher can be used to find Python
npm ERR! gyp ERR! find Python - "py.exe" is not in PATH or produced an error
npm ERR! gyp ERR! find Python
npm ERR! gyp ERR! find Python **********************************************************
npm ERR! gyp ERR! find Python You need to install the latest version of Python.
npm ERR! gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
npm ERR! gyp ERR! find Python you can try one of the following options:
npm ERR! gyp ERR! find Python - Use the switch --python="C:\Path\To\python.exe"
npm ERR! gyp ERR! find Python   (accepted by both node-gyp and npm)
npm ERR! gyp ERR! find Python - Set the environment variable PYTHON
npm ERR! gyp ERR! find Python - Set the npm configuration variable python:
npm ERR! gyp ERR! find Python   npm config set python "C:\Path\To\python.exe"
npm ERR! gyp ERR! find Python For more information consult the documentation at:
npm ERR! gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
npm ERR! gyp ERR! find Python **********************************************************
npm ERR! gyp ERR! find Python
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Could not find any Python installation to use
npm ERR! gyp ERR! stack     at PythonFinder.fail (C:\Users\Lloyd\source\repos\node_modules\node-gyp\lib\find-python.js:302:47)
npm ERR! gyp ERR! stack     at PythonFinder.runChecks (C:\Users\Lloyd\source\repos\node_modules\node-gyp\lib\find-python.js:136:21)
npm ERR! gyp ERR! stack     at PythonFinder.<anonymous> (C:\Users\Lloyd\source\repos\node_modules\node-gyp\lib\find-python.js:200:18)
npm ERR! gyp ERR! stack     at PythonFinder.execFileCallback (C:\Users\Lloyd\source\repos\node_modules\node-gyp\lib\find-python.js:266:16)
npm ERR! gyp ERR! stack     at exithandler (node:child_process:404:5)
npm ERR! gyp ERR! stack     at ChildProcess.errorhandler (node:child_process:416:5)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:390:28)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:288:12)
npm ERR! gyp ERR! stack     at onErrorNT (node:internal/child_process:475:16)
npm ERR! gyp ERR! stack     at processTicksAndRejections (node:internal/process/task_queues:83:21)
npm ERR! gyp ERR! System Windows_NT 10.0.19042
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Lloyd\\source\\repos\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd C:\Users\Lloyd\source\repos\website\frontend\node_modules\deasync
npm ERR! gyp ERR! node -v v17.0.0
npm ERR! gyp ERR! node-gyp -v v7.1.2
npm ERR! gyp ERR! not ok
npm ERR! Build failed

(As for why npm install needs to run a C++ compiler via Python, rather than just having the binary on npm, that’s a whole other topic…)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:9
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

9reactions
nogic1008commented, Oct 26, 2021

vue-jest@3.x is no longer supported. Please upgrade to @vue/cli-plugin-unit-jest that uses supported vue-jest.

npm install --save-dev @vue/cli-plugin-unit-jest@next @vue/vue2-jest jest
1reaction
zquanghoangzcommented, Nov 2, 2021

vue-jest@3.x is no longer supported. Please upgrade to @vue/cli-plugin-unit-jest that uses supported vue-jest.

npm install --save-dev @vue/cli-plugin-unit-jest@next @vue/vue2-jest jest

For Vue3 I modify the script a bit. First step is remove all Jest related, then run below command npm install --save-dev @vue/cli-plugin-unit-jest@next @vue/vue3-jest jest ts-jest

In my case I’m using typescript, if your project don’t need that then remove ts-jest, what I changed here is @vue/vue3-jest

Hope this help!

Read more comments on GitHub >

github_iconTop Results From Across the Web

deasync - npm
DeAsync turns async function into sync, implemented with a blocking mechanism by calling Node.js event loop at JavaScript layer.
Read more >
Why do I get these errors: "deasync" & "node build.js ...
I don't know why this worked, but running a regular yarn-upgrade cleared the errors. I still got warnings about dependencies.
Read more >
cannot resolve "@vue/vue2-jest" module. please make sure ...
Please remove dependency on deasync · Issue #403 · vuejs/vue . ... I can see that deasync is a dependency of vue-jest: ......
Read more >
scullyio/community - Gitter
hi guys, i try to build my scully project in a docker container, but when scully runs puppeteer i get the following error:...
Read more >
Error on setting up the client app for lesson 7 (Ultimate Django ...
Please, upgrade your dependencies to the actual version of core-js. ... Uploading Files/Client App/storefront3_client/node_modules/deasync
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found