我尝试构建在 Intel 机器上构建的 js 项目。但是在 Apple Silicon M1 上我收到了这个错误。将此库添加到 package.json 没有任何改变。
⠴ Building for production...
ERROR Failed to compile with 5 errors 17:09:42
These dependencies were not found:
* @/views/Offer/components/Documents.vue in ./node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/@vue/cli-plugin-typescript/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-3!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./src/views/Offer/Offer.vue?vue&type=script&lang=ts
* @/views/Offer/components/OfferSeller.vue in ./node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/@vue/cli-plugin-typescript/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-3!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./src/views/Offer/Offer.vue?vue&type=script&lang=ts
* @/views/Offer/components/OfferTop.vue in ./node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/@vue/cli-plugin-typescript/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-3!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./src/views/Offer/Offer.vue?vue&type=script&lang=ts
* @/views/Offer/components/ParamsList.vue in ./node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/@vue/cli-plugin-typescript/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-3!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./src/views/Offer/Offer.vue?vue&type=script&lang=ts
* @/views/Offer/components/PaymentTypes.vue in ./node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/@vue/cli-plugin-typescript/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-3!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./src/views/Offer/Offer.vue?vue&type=script&lang=ts
To install them, you can run: npm install --save @/views/Offer/components/Documents.vue @/views/Offer/components/OfferSeller.vue @/views/Offer/components/OfferTop.vue @/views/Offer/components/ParamsList.vue @/views/Offer/components/PaymentTypes.vue
ERROR Build failed with errors.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
yarn build
运行 vue-cli-service build
。
yarn build
或 npm run build
给出相同的结果。
答案 0 :(得分:0)
问题原来是不区分大小写的 HFS+ macos 文件系统。 Offer
目录中有 2 个目录:Components
和 components
。操作系统将它们视为一个文件夹。因此,构建崩溃了。
将 components
重命名为 components2
后构建成功完成。