Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/391.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Nuxt/Gitlab:警告:公共:没有匹配的文件错误:没有要上载的文件_Javascript_Gitlab_Vuetify.js_Nuxt.js - Fatal编程技术网

Javascript Nuxt/Gitlab:警告:公共:没有匹配的文件错误:没有要上载的文件

Javascript Nuxt/Gitlab:警告:公共:没有匹配的文件错误:没有要上载的文件,javascript,gitlab,vuetify.js,nuxt.js,Javascript,Gitlab,Vuetify.js,Nuxt.js,我正在尝试在Gitlab上部署我的Nuxt.js/Vuetify应用程序。我的应用程序在本地机器上运行良好 .gitlab.ci.yml 这是我的.gitlab ci.yml文件,建议如下: nuxt-config.js 以下是我的nuxt.config.js文件的内容: module.exports = { /* ** Headers of the page */ head: { title: 'fending4', meta: [

我正在尝试在Gitlab上部署我的Nuxt.js/Vuetify应用程序。我的应用程序在本地机器上运行良好

.gitlab.ci.yml 这是我的
.gitlab ci.yml
文件,建议如下:

nuxt-config.js 以下是我的nuxt.config.js文件的内容:

module.exports = {
    /*
    ** Headers of the page
    */
    head: {
    title: 'fending4',
    meta: [
        { charset: 'utf-8' },
        { name: 'viewport', content: 'width=device-width, initial-scale=1' },
        { hid: 'description', name: 'description', content: 'Nuxt.js project' }
    ],
    link: [
        { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
        { rel: 'stylesheet', type: 'text/css', href: 'https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900|Material+Icons'}
    ]
    },


    /*
    ** Customize the progress bar color
    */
    loading: { color: '#3B8070' },
    /*
    ** Build configuration
    */
    build: {
    /*
    ** Run ESLint on save
    */
    extend (config, { isDev, isClient }) {
        if (isDev && isClient) {
        config.module.rules.push({
            test: /\.(js|vue)$/,
            enforce: 'pre',
            loader: 'eslint-loader',
            exclude: /(node_modules)/
        });
        config.module.rules.push({
            test: /\.css$/,
            loader: ['css-loader', 'stylus-loader'],
            exclude: /(node_modules)/
        });
        };      
    }   
    },
    maxChunkSize: 400000,
    performance: {
        hints: false
    }
}
错误消息 我收到以下错误消息:

2018-09-12T10:33:22.028Z nuxt: Call generate:distRemoved hooks (1)
2018-09-12T10:33:22.028Z nuxt:generate Destination folder cleaned
2018-09-12T10:33:22.034Z nuxt: Call generate:distCopied hooks (1)
2018-09-12T10:33:22.034Z nuxt:generate Static & build files copied
2018-09-12T10:33:22.037Z nuxt:render Rendering url /
2018-09-12T10:33:24.320Z nuxt: Call generate:page hooks (1)
2018-09-12T10:33:24.321Z nuxt:generate Generate file: /index.html
2018-09-12T10:33:24.324Z nuxt:render Rendering url /
2018-09-12T10:33:24.325Z nuxt: Call generate:done hooks (1)
2018-09-12T10:33:24.326Z nuxt:generate HTML Files generated in 24.5s
2018-09-12T10:33:24.326Z nuxt:generate Generate done
Creating cache default...
node_modules/: found 22322 matching files          
Uploading cache.zip to http://runners-cache-3-internal.gitlab.com:444/runner/project/8345221/default 
Created cache
Uploading artifacts...
WARNING: public: no matching files                 
ERROR: No files to upload                          
Job succeeded
截图


有什么提示吗?

我想问题如下:

  artifacts:
    paths:
      - public
Nuxt将生成到dist文件夹,而不是公共文件夹

所以你需要这样的东西

  artifacts:
    paths:
      - dist

有两种方法可以做到这一点

  • 您可以在nuxt.config.js文件中更改生成的文件夹
  • 您可以将内容从dist文件夹移动到公用文件夹

  • 不包括。取而代之的是,直接将文本复制粘贴到你的问题中,而不清楚你的问题是什么。你想让捆绑包变小,还是根本不起作用?在我的本地机器上,Nuxt应用程序工作得很好。我在Gitlab上遇到了这个错误,我想在那里进行集成测试和部署@Aldarund@BillalBEGUERADJ嗯,包大小只是一个警告,它不是一个问题。我看到一个浏览器或没有文件要上传,这可能是它不工作的原因。you.gitlab-ci.yml看起来一点也不像yml:)谢谢你的尝试,但在gitlab上,文件必须生成到公共目录中,这与在本地服务器上工作时不同machine@BillalBEGUERADJ它定义了要上传的内容,而不是它在gitlab上的位置。因此,您需要上传在dist文件夹中的nuxt生成的文件,而不是public@BillalBEGUERADJ对
      artifacts:
        paths:
          - dist
    
    module.exports = {
     // custom generated folder
      generate: {
        dir: 'public'
      }
    }
    
    script:
      - npm run build
      - mv dist public