我正在尝试在命令行中创建一个nuxt应用程序,将以此和Vuetify运行一个Vue Web应用程序。我不确定自己在做什么错,但是我运行了文档告诉我运行的确切脚手架命令,并且每次出现此消息时都会出错。
PS C:\users\gman\documents\github> npx create-nuxt-app myappname
create-nuxt-app v2.15.0
✨ Generating Nuxt.js project in myappname
Trace: Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: C:\Users\GMan\AppData\Roaming\npm-cache\_npx\23248\node_modules\create-nuxt-app\node_modules\is-promise\index.js
require() of ES modules is not supported.
require() of C:\Users\GMan\AppData\Roaming\npm-cache\_npx\23248\node_modules\create-nuxt-app\node_modules\is-promise\index.js from C:\Users\GMan\AppData\Roaming\npm-cache\_npx\23248\node_modules\create-nuxt-app\node_modules\run-async\index.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules.
Instead rename C:\Users\GMan\AppData\Roaming\npm-cache\_npx\23248\node_modules\create-nuxt-app\node_modules\is-promise\index.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from C:\Users\GMan\AppData\Roaming\npm-cache\_npx\23248\node_modules\create-nuxt-app\node_modules\is-promise\package.json.
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1172:13)
at Module.load (internal/modules/cjs/loader.js:1000:32)
at Function.Module._load (internal/modules/cjs/loader.js:899:14)
at Module.require (internal/modules/cjs/loader.js:1042:19)
at require (internal/modules/cjs/helpers.js:77:18)
at Object.<anonymous> (C:\Users\GMan\AppData\Roaming\npm-cache\_npx\23248\node_modules\create-nuxt-app\node_modules\run-async\index.js:3:17)
at Module._compile (internal/modules/cjs/loader.js:1156:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1176:10)
at Module.load (internal/modules/cjs/loader.js:1000:32)
at Function.Module._load (internal/modules/cjs/loader.js:899:14) {
code: 'ERR_REQUIRE_ESM'
}
at C:\Users\GMan\AppData\Roaming\npm-cache\_npx\23248\node_modules\create-nuxt-app\cli.js:46:17
有其他人遇到这个问题,谷歌搜索什么都没发现,我想在这里检查一下是否有人知道会发生什么。
谢谢!
我确定is-promise于2小时前提出了一项失败的承诺。他们正在修复这听起来像。
我在节点12上有同样的问题。我已经尝试过npm clean cache甚至重新安装节点,但是没有用。
create-nuxt-app v2.15.0
✨ Generating Nuxt.js project in admin-akululus
Trace: Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: C:\Users\AlfianFaiz\AppData\Roaming\npm-cache\_npx\96\node_modules\create-nuxt-app\node_modules\is-promise\index.js
require() of ES modules is not supported.
require() of C:\Users\AlfianFaiz\AppData\Roaming\npm-cache\_npx\96\node_modules\create-nuxt-app\node_modules\is-promise\index.js from C:\Users\AlfianFaiz\AppData\Roaming\npm-cache\_npx\96\node_modules\create-nuxt-app\node_modules\run-async\index.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules.
Instead rename C:\Users\AlfianFaiz\AppData\Roaming\npm-cache\_npx\96\node_modules\create-nuxt-app\node_modules\is-promise\index.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from C:\Users\AlfianFaiz\AppData\Roaming\npm-cache\_npx\96\node_modules\create-nuxt-app\node_modules\is-promise\package.json.