Closed Ran-Xing closed 1 month ago
大佬,真机 也报错了
root@86ec0a5ce0f0:/# npm run build:h5-netlify
> md@1.5.9 build:h5-netlify
> cross-env SERVER_ENV=NETLIFY vue-cli-service build
All browser targets in the browserslist configuration have supported ES module.
Therefore we don't build two separate bundles for differential loading.
⠸ Building for production...[@vue/compiler-sfc] the >>> and /deep/ combinators have been deprecated. Use :deep() instead.
⠋ Building for production...[@vue/compiler-sfc] the >>> and /deep/ combinators have been deprecated. Use :deep() instead.
[@vue/compiler-sfc] ::v-deep usage as a combinator has been deprecated. Use :deep(<inner-selector>) instead.
[@vue/compiler-sfc] the >>> and /deep/ combinators have been deprecated. Use :deep() instead.
[@vue/compiler-sfc] the >>> and /deep/ combinators have been deprecated. Use :deep() instead.
[@vue/compiler-sfc] the >>> and /deep/ combinators have been deprecated. Use :deep() instead.
[@vue/compiler-sfc] the >>> and /deep/ combinators have been deprecated. Use :deep() instead.
[@vue/compiler-sfc] the >>> and /deep/ combinators have been deprecated. Use :deep() instead.
[@vue/compiler-sfc] the >>> and /deep/ combinators have been deprecated. Use :deep() instead.
[@vue/compiler-sfc] the >>> and /deep/ combinators have been deprecated. Use :deep() instead.
[@vue/compiler-sfc] the >>> and /deep/ combinators have been deprecated. Use :deep() instead.
[@vue/compiler-sfc] ::v-deep usage as a combinator has been deprecated. Use :deep(<inner-selector>) instead.
⠴ Building for production...[@vue/compiler-sfc] the >>> and /deep/ combinators have been deprecated. Use :deep() instead.
⠸ Building for production...
ERROR Failed to compile with 13 errors 12:42:08 PM
[eslint] ESLint is not a constructor
You may use special comments to disable some warnings.
Use // eslint-disable-next-line to ignore the next line.
Use /* eslint-disable */ to ignore all warnings in a file.
error in /node_modules/amdefine/amdefine.js
Module not found: Error: Can't resolve 'path' in '/node_modules/amdefine'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "path": require.resolve("path-browserify") }'
- install 'path-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "path": false }
error in /src/api/file.js
Module not found: Error: Can't resolve 'ali-oss' in '/src/api'
error in /node_modules/minio/dist/main/minio.js
Module not found: Error: Can't resolve 'crypto' in '/node_modules/minio/dist/main'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "crypto": require.resolve("crypto-browserify") }'
- install 'crypto-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "crypto": false }
error in /node_modules/minio/dist/main/minio.js
Module not found: Error: Can't resolve 'http' in '/node_modules/minio/dist/main'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "http": require.resolve("stream-http") }'
- install 'stream-http'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "http": false }
error in /node_modules/minio/dist/main/minio.js
Module not found: Error: Can't resolve 'https' in '/node_modules/minio/dist/main'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "https": require.resolve("https-browserify") }'
- install 'https-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "https": false }
error in /node_modules/minio/dist/main/minio.js
Module not found: Error: Can't resolve 'stream' in '/node_modules/minio/dist/main'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "stream": require.resolve("stream-browserify") }'
- install 'stream-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "stream": false }
error in /node_modules/minio/node_modules/source-map-support/source-map-support.js
Module not found: Error: Can't resolve 'path' in '/node_modules/minio/node_modules/source-map-support'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "path": require.resolve("path-browserify") }'
- install 'path-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "path": false }
error in /node_modules/minio/node_modules/source-map-support/source-map-support.js
Module not found: Error: Can't resolve 'fs' in '/node_modules/minio/node_modules/source-map-support'
error in /node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js
Module not found: Error: Can't resolve 'stream' in '/node_modules/through2/node_modules/readable-stream/lib'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "stream": require.resolve("stream-browserify") }'
- install 'stream-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "stream": false }
error in /node_modules/through2/through2.js
Module not found: Error: Can't resolve 'util' in '/node_modules/through2'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "util": require.resolve("util/") }'
- install 'util'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "util": false }
error in /node_modules/xml/lib/xml.js
Module not found: Error: Can't resolve 'stream' in '/node_modules/xml/lib'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "stream": require.resolve("stream-browserify") }'
- install 'stream-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "stream": false }
Error: Child compilation failed:
[eslint] ESLint is not a constructor
- child-compiler.js:169
[cli-service]/[html-webpack-plugin]/lib/child-compiler.js:169:18
- Compiler.js:551 finalCallback
[cli-service]/[webpack]/lib/Compiler.js:551:5
- Compiler.js:577
[cli-service]/[webpack]/lib/Compiler.js:577:11
- Compiler.js:1199
[cli-service]/[webpack]/lib/Compiler.js:1199:17
- Hook.js:18 Hook.CALL_ASYNC_DELEGATE [as _callAsync]
[cli-service]/[tapable]/lib/Hook.js:18:14
- Compiler.js:1195
[cli-service]/[webpack]/lib/Compiler.js:1195:33
- Compilation.js:2787 finalCallback
[cli-service]/[webpack]/lib/Compilation.js:2787:11
- Compilation.js:3092
[cli-service]/[webpack]/lib/Compilation.js:3092:11
ERROR Error: Build failed with errors.
Error: Build failed with errors.
at /node_modules/@vue/cli-service/lib/commands/build/index.js:207:23
at /node_modules/@vue/cli-service/node_modules/webpack/lib/webpack.js:148:8
at /node_modules/@vue/cli-service/node_modules/webpack/lib/HookWebpackError.js:68:3
at Hook.eval [as callAsync] (eval at create (/node_modules/@vue/cli-service/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/node_modules/@vue/cli-service/node_modules/tapable/lib/Hook.js:18:14)
at Cache.shutdown (/node_modules/@vue/cli-service/node_modules/webpack/lib/Cache.js:150:23)
at /node_modules/@vue/cli-service/node_modules/webpack/lib/Compiler.js:1228:15
at Hook.eval [as callAsync] (eval at create (/node_modules/@vue/cli-service/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/node_modules/@vue/cli-service/node_modules/tapable/lib/Hook.js:18:14)
at Compiler.close (/node_modules/@vue/cli-service/node_modules/webpack/lib/Compiler.js:1221:23)
root@86ec0a5ce0f0:/#
啊,不会吧,线上最新代码我们是 build 通过的
docker run -it --name nodejs --rm node bash
git clone https://github.com/doocs/md.git /tmp/www && cp -r /tmp/www/* . && npm i && npm run build:h5-netlify
@yanglbme 你试试,也许有可能是node版本问题
Last login: Fri Apr 28 20:34:40 2023 from xxx.xxx.xxx.xxx
➜ ~ docker run -it --name nodejs --rm node bash
root@15924c7392db:/# git clone https://github.com/doocs/md.git /tmp/www && cp -r /tmp/www/* . && npm i && npm run build:h5-netlify
Cloning into '/tmp/www'...
remote: Enumerating objects: 5631, done.
remote: Total 5631 (delta 0), reused 0 (delta 0), pack-reused 5631
Receiving objects: 100% (5631/5631), 165.69 MiB | 5.29 MiB/s, done.
Resolving deltas: 100% (3272/3272), done.
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: '@achrinza/node-ipc@9.2.2',
npm WARN EBADENGINE required: { node: '8 || 10 || 12 || 14 || 16 || 17' },
npm WARN EBADENGINE current: { node: 'v20.0.0', npm: '9.6.4' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: 'minio@7.0.29',
npm WARN EBADENGINE required: { node: '>8 <=18' },
npm WARN EBADENGINE current: { node: 'v20.0.0', npm: '9.6.4' }
npm WARN EBADENGINE }
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated svgo@1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x.
npm WARN deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated html-webpack-plugin@3.2.0: 3.x is no longer supported
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated eslint-loader@2.2.1: This loader has been deprecated. Please use eslint-webpack-plugin
npm WARN deprecated babel-eslint@10.1.0: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.
npm WARN deprecated @hapi/bourne@1.3.2: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/hoek@8.5.1: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/topo@3.1.6: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/joi@15.1.1: Switch to 'npm install joi'
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.
npm WARN deprecated chokidar@2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
npm WARN deprecated chokidar@2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
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.
npm WARN deprecated querystring@0.2.1: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated mkdirp@0.3.5: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
npm WARN deprecated core-js@2.6.12: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
npm WARN deprecated @hapi/address@2.1.4: Moved to 'npm install @sideway/address'
npm WARN deprecated core-js@2.6.12: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
> md@1.5.9 prepare
> husky install
fatal: not a git repository (or any of the parent directories): .git
added 2175 packages, and audited 2176 packages in 3m
56 vulnerabilities (1 low, 22 moderate, 21 high, 12 critical)
To address issues that do not require attention, run:
npm audit fix
To address all issues possible (including breaking changes), run:
npm audit fix --force
Some issues need review, and may require choosing
a different dependency.
Run `npm audit` for details.
npm notice
npm notice New patch version of npm available! 9.6.4 -> 9.6.5
npm notice Changelog: https://github.com/npm/cli/releases/tag/v9.6.5
npm notice Run npm install -g npm@9.6.5 to update!
npm notice
> md@1.5.9 build:h5-netlify
> cross-env SERVER_ENV=NETLIFY vue-cli-service build
⠸ Building for production...Error: error:0308010C:digital envelope routines::unsupported
at new Hash (node:internal/crypto/hash:69:19)
at Object.createHash (node:crypto:138:10)
at module.exports (/node_modules/webpack/lib/util/createHash.js:135:53)
at NormalModule._initBuildHash (/node_modules/webpack/lib/NormalModule.js:417:16)
at handleParseError (/node_modules/webpack/lib/NormalModule.js:471:10)
at /node_modules/webpack/lib/NormalModule.js:503:5
at /node_modules/webpack/lib/NormalModule.js:358:12
at /node_modules/loader-runner/lib/LoaderRunner.js:373:3
at iterateNormalLoaders (/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
at iterateNormalLoaders (/node_modules/loader-runner/lib/LoaderRunner.js:221:10)
at /node_modules/loader-runner/lib/LoaderRunner.js:236:3
at runSyncOrAsync (/node_modules/loader-runner/lib/LoaderRunner.js:130:11)
at iterateNormalLoaders (/node_modules/loader-runner/lib/LoaderRunner.js:232:2)
at Array.<anonymous> (/node_modules/loader-runner/lib/LoaderRunner.js:205:4)
at Storage.finished (/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:55:16)
at /node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:91:9
⠏ Building for production.../node_modules/loader-runner/lib/LoaderRunner.js:114
throw e;
^
Error: error:0308010C:digital envelope routines::unsupported
at new Hash (node:internal/crypto/hash:69:19)
at Object.createHash (node:crypto:138:10)
at module.exports (/node_modules/webpack/lib/util/createHash.js:135:53)
at NormalModule._initBuildHash (/node_modules/webpack/lib/NormalModule.js:417:16)
at /node_modules/webpack/lib/NormalModule.js:452:10
at /node_modules/webpack/lib/NormalModule.js:323:13
at /node_modules/loader-runner/lib/LoaderRunner.js:367:11
at /node_modules/loader-runner/lib/LoaderRunner.js:182:20
at context.callback (/node_modules/loader-runner/lib/LoaderRunner.js:111:13)
at Object.callback (/node_modules/thread-loader/dist/index.js:46:7)
at done (/node_modules/neo-async/async.js:8069:18)
at callback (/node_modules/thread-loader/dist/WorkerPool.js:178:19)
at /node_modules/thread-loader/dist/WorkerPool.js:204:15
at mapSeries (/node_modules/neo-async/async.js:3625:14)
at PoolWorker.onWorkerMessage (/node_modules/thread-loader/dist/WorkerPool.js:170:35)
at /node_modules/thread-loader/dist/WorkerPool.js:152:14 {
opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
library: 'digital envelope routines',
reason: 'unsupported',
code: 'ERR_OSSL_EVP_UNSUPPORTED'
}
Node.js v20.0.0
root@15924c7392db:/#
我在vercel上使用 git clone https://github.com/doocs/md.git /tmp/www && cp -r /tmp/www/* . && npm i && npm run build:h5-netlify 进行部署,也出现了如下错误
Error: error:0308010C:digital envelope routines::unsupported
11:50:44.249 | at new Hash (node:internal/crypto/hash:71:19)
11:50:44.249 | at Object.createHash (node:crypto:133:10)
11:50:44.249 | at module.exports (/vercel/path0/node_modules/webpack/lib/util/createHash.js:135:53)
11:50:44.249 | at NormalModule._initBuildHash (/vercel/path0/node_modules/webpack/lib/NormalModule.js:417:16)
11:50:44.249 | at handleParseError (/vercel/path0/node_modules/webpack/lib/NormalModule.js:471:10)
11:50:44.250 | at /vercel/path0/node_modules/webpack/lib/NormalModule.js:503:5
11:50:44.250 | at /vercel/path0/node_modules/webpack/lib/NormalModule.js:358:12
11:50:44.250 | at /vercel/path0/node_modules/loader-runner/lib/LoaderRunner.js:373:3
11:50:44.250 | at iterateNormalLoaders (/vercel/path0/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
11:50:44.250 | at iterateNormalLoaders (/vercel/path0/node_modules/loader-runner/lib/LoaderRunner.js:221:10)
11:50:44.250 | at /vercel/path0/node_modules/loader-runner/lib/LoaderRunner.js:236:3
11:50:44.250 | at runSyncOrAsync (/vercel/path0/node_modules/loader-runner/lib/LoaderRunner.js:130:11)
11:50:44.250 | at iterateNormalLoaders (/vercel/path0/node_modules/loader-runner/lib/LoaderRunner.js:232:2)
11:50:44.250 | at Array.
如果只使用npm run build:h5-netlify的话,也会报错
@yanglbme 老兄咋样呀,弄好了没得
@Ran-Xing 拉一下最新代码试试,我刚刚用 GitHub Action 部署,是成功的
@yanglbme 依然不行
我用docker node16 跑了一下,也是一样不行
报了什么错
@Ran-Xing createHash 报错的问题,昨天已经处理
root@262401f71b69:/# git clone https://github.com/doocs/md.git /tmp/www && cp -r /tmp/www/* . && npm i && npm run build
Cloning into '/tmp/www'...
remote: Enumerating objects: 5662, done.
remote: Counting objects: 100% (46/46), done.
remote: Compressing objects: 100% (33/33), done.
^Cceiving objects: 20% (1155/5662), 2.97 MiB | 1.92 MiB/s s
root@262401f71b69:/# git clone https://github.com/doocs/md.git /tmp/www && cp -r /tmp/www/* . && npm i && npm start
Cloning into '/tmp/www'...
remote: Enumerating objects: 5662, done.
remote: Counting objects: 100% (46/46), done.
remote: Compressing objects: 100% (33/33), done.
remote: Total 5662 (delta 12), reused 35 (delta 10), pack-reused 5616
Receiving objects: 100% (5662/5662), 167.32 MiB | 3.81 MiB/s, done.
Resolving deltas: 100% (3273/3273), done.
npm WARN deprecated w3c-hr-time@1.0.2: Use your platform's native performance.now() and performance.timeOrigin.
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated sourcemap-codec@1.4.8: Please use @jridgewell/sourcemap-codec instead
npm WARN deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated querystring@0.2.1: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated html-webpack-plugin@3.2.0: 3.x is no longer supported
npm WARN deprecated svgo@1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x.
npm WARN deprecated eslint-loader@2.2.1: This loader has been deprecated. Please use eslint-webpack-plugin
npm WARN deprecated babel-eslint@10.1.0: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.
npm WARN deprecated @npmcli/move-file@1.1.2: This functionality has been moved to @npmcli/fs
npm WARN deprecated @hapi/topo@3.1.6: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/bourne@1.3.2: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/address@2.1.4: Moved to 'npm install @sideway/address'
npm WARN deprecated @hapi/hoek@8.5.1: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/joi@15.1.1: Switch to 'npm install joi'
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.
npm WARN deprecated chokidar@2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
npm WARN deprecated chokidar@2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
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.
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.
npm WARN deprecated mkdirp@0.3.5: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
npm WARN deprecated core-js@2.6.12: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
npm WARN deprecated core-js@2.6.12: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
> md@1.5.9 prepare
> husky install
fatal: not a git repository (or any of the parent directories): .git
added 2349 packages, and audited 2807 packages in 54s
167 packages are looking for funding
run `npm fund` for details
72 vulnerabilities (1 low, 25 moderate, 35 high, 11 critical)
To address issues that do not require attention, run:
npm audit fix
To address all issues possible (including breaking changes), run:
npm audit fix --force
Some issues need review, and may require choosing
a different dependency.
Run `npm audit` for details.
npm notice
npm notice New major version of npm available! 8.19.4 -> 9.6.6
npm notice Changelog: https://github.com/npm/cli/releases/tag/v9.6.6
npm notice Run npm install -g npm@9.6.6 to update!
npm notice
> md@1.5.9 start
> npm run lint -- --fix && run-p serve mm
> md@1.5.9 lint /
> vue-cli-service lint src && vue-cli-service lint mm "--fix"
error: Parsing error: Unexpected token < at src/App.vue:1:1:
> 1 | <template>
| ^
2 | <div id="app">
3 | <router-view></router-view>
4 | </div>
error: Parsing error: The keyword 'const' is reserved at src/api/config.js:1:1:
> 1 | const githubConfig = {
| ^
2 | username: `filess`,
3 | repoList: Array.from(
4 | [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19],
error: Parsing error: The keyword 'import' is reserved at src/api/fetch.js:1:1:
> 1 | import axios from 'axios'
| ^
2 |
3 | // 创建axios实例
4 | const service = axios.create({
error: Parsing error: The keyword 'import' is reserved at src/api/file.js:1:1:
> 1 | import fetch from './fetch'
| ^
2 | import { githubConfig, giteeConfig } from './config'
3 | import CryptoJS from 'crypto-js'
4 | import OSS from 'ali-oss'
error: Parsing error: The keyword 'export' is reserved at src/assets/scripts/config.js:1:1:
> 1 | export default {
| ^
2 | builtinFonts: [
3 | {
4 | label: `无衬线`,
error: Parsing error: The keyword 'import' is reserved at src/assets/scripts/converter.js:1:1:
> 1 | import juice from 'juice'
| ^
2 |
3 | export function solveWeChatImage() {
4 | const clipboardDiv = document.getElementById(`output`)
error: Parsing error: The keyword 'import' is reserved at src/assets/scripts/renderers/wx-renderer.js:1:1:
> 1 | import { Renderer } from "marked";
| ^
2 | import hljs from 'highlight.js';
3 |
4 | class WxRenderer {
error: Parsing error: Unexpected token baseColor at src/assets/scripts/themes/default-theme.js:1:5:
> 1 | let baseColor = `#3f3f3f`
| ^
2 |
3 | export default {
4 | BASE: {
error: Parsing error: The keyword 'export' is reserved at src/assets/scripts/tokenTools.js:1:1:
> 1 | export function utf16to8(str) {
| ^
2 | var out, i, len, c
3 | out = ``
4 | len = str.length
error: Parsing error: The keyword 'import' is reserved at src/assets/scripts/util.js:1:1:
> 1 | import prettier from 'prettier/standalone'
| ^
2 | import prettierCss from 'prettier/parser-postcss'
3 | import prettierMarkdown from 'prettier/parser-markdown'
4 | import defaultTheme from './themes/default-theme'
error: Parsing error: Unexpected token < at src/components/CodemirrorEditor/AboutDialog.vue:1:1:
> 1 | <template>
| ^
2 | <el-dialog
3 | title="关于"
4 | class="about__dialog"
error: Parsing error: Unexpected token < at src/components/CodemirrorEditor/CssEditor.vue:1:1:
> 1 | <template>
| ^
2 | <transition enter-active-class="bounceInRight">
3 | <el-col :span="12" v-show="showCssEditor" class="cssEditor-wrapper">
4 | <textarea
error: Parsing error: Unexpected token < at src/components/CodemirrorEditor/EditorHeader/PostInfoDialog.vue:1:1:
> 1 | <template>
| ^
2 | <el-dialog title="发布" :visible.sync="form.dialogVisible">
3 | <el-alert
4 | style="margin-bottom: 1em"
error: Parsing error: Unexpected token < at src/components/CodemirrorEditor/EditorHeader/ResetDialog.vue:1:1:
> 1 | <template>
| ^
2 | <el-dialog
3 | title="提示"
4 | class="reset__dialog"
error: Parsing error: Unexpected token < at src/components/CodemirrorEditor/EditorHeader/StyleOptionMenu.vue:1:1:
> 1 | <template>
| ^
2 | <el-dropdown placement="right" class="style-option-menu">
3 | <div class="el-dropdown-link">
4 | {{ label }}
error: Parsing error: Unexpected token < at src/components/CodemirrorEditor/EditorHeader/index.vue:1:1:
> 1 | <template>
| ^
2 | <el-container class="header-container is-dark">
3 | <div class="dropdowns">
4 | <el-dropdown>
error: Parsing error: Unexpected token < at src/components/CodemirrorEditor/InsertFormDialog.vue:1:1:
> 1 | <template>
| ^
2 | <el-dialog
3 | title="插入表格"
4 | class="insert__dialog"
error: Parsing error: Unexpected token < at src/components/CodemirrorEditor/RightClickMenu.vue:1:1:
> 1 | <template>
| ^
2 | <div
3 | id="menu"
4 | class="menu"
error: Parsing error: Unexpected token < at src/components/CodemirrorEditor/UploadImgDialog.vue:1:1:
> 1 | <template>
| ^
2 | <el-dialog
3 | title="本地上传"
4 | class="upload__dialog"
error: Parsing error: Unexpected token < at src/components/RunLoading.vue:1:1:
> 1 | <template>
| ^
2 | <transition name="fade" v-if="loading">
3 | <div
4 | class="loading"
error: Parsing error: The keyword 'import' is reserved at src/main.js:1:1:
> 1 | import Vue from 'vue'
| ^
2 | import App from './App'
3 | import store from './store'
4 | import ElementUI from 'element-ui'
error: Parsing error: The keyword 'import' is reserved at src/plugins/element/index.js:1:1:
> 1 | import Vue from 'vue'
| ^
2 | import { Loading, Message } from 'element-ui'
3 |
4 | Vue.component(Message.name, Message)
error: Parsing error: The keyword 'import' is reserved at src/router/index.js:1:1:
> 1 | import Vue from 'vue'
| ^
2 | import VueRouter from 'vue-router'
3 | import index from '@/views'
4 |
error: Parsing error: The keyword 'import' is reserved at src/store/index.js:1:1:
> 1 | import Vue from 'vue'
| ^
2 | import Vuex from 'vuex'
3 | import config from '../assets/scripts/config'
4 | import WxRenderer from '../assets/scripts/renderers/wx-renderer'
error: Parsing error: Unexpected token < at src/views/CodemirrorEditor.vue:1:1:
> 1 | <template>
| ^
2 | <div
3 | class="container"
4 | :class="{ container_night: nightMode }"
error: Parsing error: Unexpected token < at src/views/index.vue:1:1:
> 1 | <template>
| ^
2 | <codemirror-editor />
3 | </template>
4 |
26 errors found.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! md@1.5.9 lint: `vue-cli-service lint src && vue-cli-service lint mm "--fix"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the md@1.5.9 lint 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! /root/.npm/_logs/2023-05-11T08_11_07_559Z-debug.log
root@262401f71b69:/# exit
➜ ~
头疼,我没复现出你的问题
@yanglbme 你用这两个命令吧,一个是新建容器,一个是克隆 编译
docker run -it --name nodejs --rm node bash
git clone https://github.com/doocs/md.git /tmp/www && cp -r /tmp/www/* . && npm i && npm run build:h5-netlify
我用 docker 容器 build 时报了另一个错,感觉这玩意儿跟 node / npm 版本有关
可以用我们最新分支代码再试试看,有问题的话,可以提新的 issue