yan*_*amz 6 deployment vue.js netlify
我过去已经这样做过很多次了,我在 netlify 日志中收到此错误。我尝试部署的存储库是https://github.com/yanyamz/Key_Visual_Arts。
\n我检查了它是否在 Netlify 的大小限制内,结果是,总共 15mb 左右,而您可以在 netlify 上部署的 20+mb 左右。
\n12:03:03 PM: Build ready to start\n12:03:04 PM: build-image version: fa439ad1ab9393b2c0d449d8d7c033927683f4b0\n12:03:04 PM: build-image tag: v4.3.0\n12:03:04 PM: buildbot version: 0f2f658d862cfe72bae7cc05c6a8de0426a5a0e2\n12:03:04 PM: Fetching cached dependencies\n12:03:05 PM: Failed to fetch cache, continuing with build\n12:03:05 PM: Starting to prepare the repo for build\n12:03:05 PM: No cached dependencies found. Cloning fresh repo\n12:03:05 PM: git clone https://github.com/yanyamz/Key_Visual_Arts\n12:03:07 PM: Preparing Git Reference refs/heads/main\n12:03:07 PM: Parsing package.json dependencies\n12:03:08 PM: \n\xe2\x80\x8b\n\xe2\x9d\xaf Initial build environment\nbaseRelDir: true\nbranch: main\ncontext: production\ncwd: /opt/build/repo\nfeatureFlags: []\nmode: buildbot\nrepositoryRoot: /opt/build/repo\nsiteId: 9cc686ee-a337-4ebf-886c-99acf9adfe45\n\xe2\x80\x8b\n\xe2\x9d\xaf UI build settings\nbaseRelDir: true\nbuild:\n command: npm run build\n environment:\n - NETLIFY_BUILD_DEBUG\n publish: dist\n\xe2\x80\x8b\n\xe2\x9d\xaf Resolved build environment\nbranch: main\nbuildDir: /opt/build/repo\ncontext: production\nenv: []\n\xe2\x80\x8b\n\xe2\x9d\xaf Resolved config\nbuild:\n command: npm run build\n commandOrigin: ui\n environment:\n - NETLIFY_BUILD_DEBUG\n publish: /opt/build/repo/dist\n publishOrigin: ui\n\n12:03:08 PM: Starting build script\n12:03:08 PM: Installing dependencies\n12:03:08 PM: Python version set to 2.7\n12:03:09 PM: Downloading and installing node v16.8.0...\n12:03:09 PM: Downloading https://nodejs.org/dist/v16.8.0/node-v16.8.0-linux-x64.tar.xz...\n12:03:09 PM: Computing checksum with sha256sum\n12:03:09 PM: Checksums matched!\n12:03:12 PM: Now using node v16.8.0 (npm v7.21.0)\n12:03:12 PM: Started restoring cached build plugins\n12:03:12 PM: Finished restoring cached build plugins\n12:03:12 PM: Attempting ruby version 2.7.2, read from environment\n12:03:13 PM: Using ruby version 2.7.2\n12:03:14 PM: Using PHP version 8.0\n12:03:14 PM: Started restoring cached node modules\n12:03:14 PM: Finished restoring cached node modules\n12:03:14 PM: Installing NPM modules using NPM version 7.21.0\n12:03:16 PM: npm WARN old lockfile\n12:03:16 PM: npm WARN old lockfile The package-lock.json file was created with an old version of npm,\n12:03:16 PM: npm WARN old lockfile so supplemental metadata must be fetched from the registry.\n12:03:16 PM: npm WARN old lockfile\n12:03:16 PM: npm WARN old lockfile This is a one-time fix-up, please be patient...\n12:03:16 PM: npm WARN old lockfile\n12:03:18 PM: npm WARN old lockfile vue-loader-v16: No matching version found for vue-loader-v16@16.5.0.\n12:03:18 PM: npm WARN old lockfile at module.exports (/opt/buildhome/.nvm/versions/node/v16.8.0/lib/node_modules/npm/node_modules/npm-pick-manifest/index.js:209:23)\n12:03:18 PM: npm WARN old lockfile at /opt/buildhome/.nvm/versions/node/v16.8.0/lib/node_modules/npm/node_modules/pacote/lib/registry.js:118:26\n12:03:18 PM: npm WARN old lockfile at async Array.<anonymous> (/opt/buildhome/.nvm/versions/node/v16.8.0/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:691:9)\n12:03:18 PM: npm WARN old lockfile Could not fetch metadata for vue-loader-v16@16.5.0 vue-loader-v16: No matching version found for vue-loader-v16@16.5.0.\n12:03:18 PM: npm WARN old lockfile at module.exports (/opt/buildhome/.nvm/versions/node/v16.8.0/lib/node_modules/npm/node_modules/npm-pick-manifest/index.js:209:23)\n12:03:18 PM: npm WARN old lockfile at /opt/buildhome/.nvm/versions/node/v16.8.0/lib/node_modules/npm/node_modules/pacote/lib/registry.js:118:26\n12:03:18 PM: npm WARN old lockfile at async Array.<anonymous> (/opt/buildhome/.nvm/versions/node/v16.8.0/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:691:9) {\n12:03:18 PM: npm WARN old lockfile code: \'ETARGET\',\n12:03:18 PM: npm WARN old lockfile type: \'version\',\n12:03:18 PM: npm WARN old lockfile wanted: \'16.5.0\',\n12:03:18 PM: npm WARN old lockfile versions: [\n12:03:18 PM: npm WARN old lockfile \'16.0.0-beta.5\',\n12:03:18 PM: npm WARN old lockfile \'16.0.0-beta.5.1\',\n12:03:18 PM: npm WARN old lockfile \'16.0.0-beta.5.2\',\n12:03:18 PM: npm WARN old lockfile \'16.0.0-beta.5.3\',\n12:03:18 PM: npm WARN old lockfile \'16.0.0-beta.5.4\'\n12:03:18 PM: npm WARN old lockfile ],\n12:03:18 PM: npm WARN old lockfile distTags: { latest: \'16.0.0-beta.5.4\' },\n12:03:18 PM: npm WARN old lockfile defaultTag: \'latest\'\n12:03:18 PM: npm WARN old lockfile }\n12:03:33 PM: npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated\n12:03:33 PM: npm WARN deprecated har-validator@5.1.5: this library is no longer supported\n12:03:33 PM: npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated\n12:03:34 PM: npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.\n12:03:35 PM: npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142\n12:03:37 PM: npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.\n12:03:38 PM: npm WARN deprecated eslint-loader@2.2.1: This loader has been deprecated. Please use eslint-webpack-plugin\n12:03:39 PM: npm WARN deprecated html-webpack-plugin@3.2.0: 3.x is no longer supported\n12:03:40 PM: npm WARN deprecated babel-eslint@10.1.0: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.\n12:03:40 PM: npm WARN deprecated @hapi/topo@3.1.6: This version has been deprecated and is no longer supported or maintained\n12:03:40 PM: npm WARN deprecated @hapi/bourne@1.3.2: This version has been deprecated and is no longer supported or maintained\n12:03:41 PM: npm WARN deprecated @hapi/address@2.1.4: Moved to \'npm install @sideway/address\'\n12:03:42 PM: npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.\n12:03:42 PM: npm WARN deprecated @hapi/hoek@8.5.1: This version has been deprecated and is no longer supported or maintained\n12:03:42 PM: npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.\n12:03:43 PM: npm WARN deprecated @hapi/joi@15.1.1: Switch to \'npm install joi\'\n12:03:43 PM: npm WARN deprecated tar@2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.\n12:06:00 PM: npm ERR! code 1\n12:06:00 PM: npm ERR! path /opt/build/repo/node_modules/node-sass\n12:06:00 PM: npm ERR! command failed\n12:06:00 PM: npm ERR! command sh -c node scripts/build.js\n12:06:00 PM: npm ERR! Building: /opt/buildhome/.nvm/versions/node/v16.8.0/bin/node /opt/build/repo/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=\n12:06:00 PM: npm ERR! make: Entering directory \'/opt/build/repo/node_modules/node-sass/build\'\n12:06:00 PM: npm ERR! g++ \'-DNODE_GYP_MODULE_NAME=libsass\' \'-DUSING_UV_SHARED=1\' \'-DUSING_V8_SHARED=1\' \nRun Code Online (Sandbox Code Playgroud)\n
Ari*_*ain 18
只需卸载node-sass并安装sass-loader和sass
npm uninstall node-sass
Run Code Online (Sandbox Code Playgroud)
npm install sass-loader
npm install sass
Run Code Online (Sandbox Code Playgroud)
一切都一样!再次部署,这次就不会出现错误了。
Mic*_*evý 12
停止使用node-sass
它是本机节点包,这意味着它需要在某些环境中安装一些构建工具(某些操作系统/环境的预构建二进制文件分布在 NPM 包中,但显然不适用于 netlify 使用的工具)
最重要的是它已经被弃用了
只需卸载node-sass并安装sass - sass-loader应该会自动切换到它
小智 7
此错误是由您在节点 16.x 上运行的 Netifly 环境引起的(请参阅您的日志“12:03:12 PM: Now using Node v16.8.0 (npm v7.21.0)”),该环境与您的 node-sass 版本不兼容正在使用。
你可以参考这个:我正在尝试在netlify上托管我的react网站,但是出现了这个npm安装错误
您还可以在这里验证节点版本和node-sass之间的兼容性: https: //www.npmjs.com/package/node-sass
| 归档时间: |
|
| 查看次数: |
7168 次 |
| 最近记录: |