Describe the bug
when I download this project and run npm install
then I got these errors:
ERROR The requested module 'vue' does not provide an export named 'h'
import { getCurrentInstance, inject, onUnmounted, onDeactivated, onActivated, computed, unref, watchEffect, defineComponent, reactive, h, provide, ref, watch, shallowRef, shallowReactive, nextTick } from 'vue';
^
SyntaxError: The requested module 'vue' does not provide an export named 'h'
at ModuleJob._instantiate (internal/modules/esm/module_job.js:121:21)
at async ModuleJob.run (internal/modules/esm/module_job.js:166:5)
at async Loader.import (internal/modules/esm/loader.js:178:24)
at async loadNuxt (node_modules/@nuxt/kit/dist/index.mjs:2536:37)
at async Object.invoke (node_modules/nuxt/node_modules/nuxi/dist/chunks/prepare.mjs:31:18)
at async _main (node_modules/nuxt/node_modules/nuxi/dist/cli.mjs:49:20)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @1.2.4 postinstall: nuxi prepare
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @1.2.4 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/XXX/.npm/_logs/2023-07-25T07_17_57_974Z-debug.log
and in this log, it writes:
2298 verbose stack Error: @1.2.4 postinstall: nuxi prepare
2298 verbose stack Exit status 1
2298 verbose stack at EventEmitter. (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
2298 verbose stack at EventEmitter.emit (events.js:400:28)
2298 verbose stack at ChildProcess. (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
2298 verbose stack at ChildProcess.emit (events.js:400:28)
2298 verbose stack at maybeClose (internal/child_process.js:1055:16)
2298 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
2299 verbose pkgid @1.2.4
2300 verbose cwd /Users/zhiyu9/Downloads/qrcode-toolkit-main
2301 verbose Darwin 22.1.0
2302 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "install"
2303 verbose node v14.17.6
2304 verbose npm v6.14.15
2305 error code ELIFECYCLE
2306 error errno 1
2307 error @1.2.4 postinstall: nuxi prepare
2307 error Exit status 1
2308 error Failed at the @1.2.4 postinstall script.
2308 error This is probably not a problem with npm. There is likely additional logging output above.
2309 verbose exit [ 1, true ]
I don't know how to deal with this problem, can anyone help ? 😭
Reproduction
How to deal with problem caused by 'npm install'?
System Info
System:
OS: macOS 13.0.1
CPU: (8) x64 Intel(R) Core(TM) i5-8257U CPU @ 1.40GHz
Memory: 69.52 MB / 8.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 14.17.6 - /usr/local/bin/node
Yarn: 1.22.10 - /usr/local/bin/yarn
npm: 6.14.15 - /usr/local/bin/npm
Browsers:
Chrome: 114.0.5735.198
Safari: 16.1
Used Package Manager
npm
Validations