Please remove dependency on deasync
See original GitHub issueOut 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:
- Created 2 years ago
- Reactions:9
- Comments:6 (1 by maintainers)
Top GitHub Comments
vue-jest@3.x
is no longer supported. Please upgrade to@vue/cli-plugin-unit-jest
that uses supported vue-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!