You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
我在重啟使用cypress測試的終端機之後,就無法使用npm test測試了,一直顯示這個:
The plugins file is missing or invalid.
Your pluginsFile is set to C:\Users\jaspe\wp1101\hack2\cypress\plugins\index.js, but either the file is missing, it contains a syntax error, or threw an error when required. The pluginsFile must be a .js, .ts, or .coffee file.
Or you might have renamed the extension of your pluginsFile. If that's the case, restart the test runner.
Please fix this, or set pluginsFile to false if a plugins file is not necessary for your project.
Error [ERR_REQUIRE_ESM]: require() of ES Module C:\Users\jaspe\wp1101\hack2\cypress\plugins\index.js from C:\Users\jaspe\AppData\Local\Cypress\Cache\9.1.1\Cypress\resources\app\packages\server\lib\plugins\child\run_plugins.js not supported.
index.js is treated as an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which declares all .js files in that package scope as ES modules.
Instead rename index.js to end in .cjs, change the requiring code to use dynamic import() which is available in all CommonJS modules, or change "type": "module" to "type": "commonjs" in C:\Users\jaspe\wp1101\hack2\package.json to treat all .js files as CommonJS (using .mjs for all ES modules instead).
at runPlugins (C:\Users\jaspe\AppData\Local\Cypress\Cache\9.1.1\Cypress\resources\app\packages\server\lib\plugins\child\run_plugins.js:175:15)
at Object.<anonymous> (C:\Users\jaspe\AppData\Local\Cypress\Cache\9.1.1\Cypress\resources\app\packages\server\lib\plugins\child\index.js:8:25)
然而我完全沒有動到這些檔案。
The text was updated successfully, but these errors were encountered:
我在重啟使用cypress測試的終端機之後,就無法使用npm test測試了,一直顯示這個:
The plugins file is missing or invalid.
Your
pluginsFile
is set toC:\Users\jaspe\wp1101\hack2\cypress\plugins\index.js
, but either the file is missing, it contains a syntax error, or threw an error when required. ThepluginsFile
must be a.js
,.ts
, or.coffee
file.Or you might have renamed the extension of your
pluginsFile
. If that's the case, restart the test runner.Please fix this, or set
pluginsFile
tofalse
if a plugins file is not necessary for your project.Error [ERR_REQUIRE_ESM]: require() of ES Module C:\Users\jaspe\wp1101\hack2\cypress\plugins\index.js from C:\Users\jaspe\AppData\Local\Cypress\Cache\9.1.1\Cypress\resources\app\packages\server\lib\plugins\child\run_plugins.js not supported.
index.js is treated as an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which declares all .js files in that package scope as ES modules.
Instead rename index.js to end in .cjs, change the requiring code to use dynamic import() which is available in all CommonJS modules, or change "type": "module" to "type": "commonjs" in C:\Users\jaspe\wp1101\hack2\package.json to treat all .js files as CommonJS (using .mjs for all ES modules instead).
然而我完全沒有動到這些檔案。
The text was updated successfully, but these errors were encountered: