[英]Nuxt.config.js is not in cwd
我想在 Nuxt 項目中使用“npm run generate”,但出現錯誤:
Path C:/Users/Марина/OneDrive/Desktop/weHost/zabota-dialog/nuxt.config.js is not in cwd C:\Users\Марина\OneDrive\Desktop\weHost\zabota-dialog
Nuxt.config.js 現在位於項目根目錄中。 文件內容:
export default {
// Target: https://go.nuxtjs.dev/config-target
target: "static",
// Global page headers: https://go.nuxtjs.dev/config-head
head: {
title: "dialog-zabota",
htmlAttrs: {
lang: "en"
},
meta: [
{ charset: "utf-8" },
{ name: "viewport", content: "width=device-width, initial-scale=1" },
{ hid: "description", name: "description", content: "" }
],
link: [{ rel: "icon", type: "image/x-icon", href: "/favicon.ico" }]
},
// Global CSS: https://go.nuxtjs.dev/config-css
css: ["./assets/less/main.less"],
styleResources: {
less: ["./assets/less/static/variables.less", "./assets/less/static/font-face.less"]
},
// Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
plugins: [],
// Auto import components: https://go.nuxtjs.dev/config-components
components: true,
// Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules
buildModules: ["@nuxtjs/style-resources"],
// Modules: https://go.nuxtjs.dev/config-modules
modules: [],
// Build Configuration: https://go.nuxtjs.dev/config-build
build: {}
};
我做錯了什么? 為什么它沒有運行?
由於我在基於 UNIX 的系統上,因此不確定如何修復它,但實際上存在差異
C:\Users\Марина\OneDrive\Desktop\weHost\zabota-dialog
對比
C:/Users/Марина/OneDrive/Desktop/weHost/zabota-dialog/nuxt.config.js
斜線不匹配, \
vs /
。 您是否對系統進行了一些特定配置?
這可能會有所幫助: windows 中的 Nodejs 絕對路徑,帶有正斜杠
或任何帶有npm backslash windows
關鍵字的谷歌查詢。
我可以建議以后不要在路徑中使用西里爾文它對我有幫助
我認為它也可能因為非 ASCII 字符而發生。 我在土耳其語中使用 Windows,所以我的路徑上有一個“/Masaüstü/”部分,我將我的文件夾帶到 C:/src 並解決了問題。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.