PS D:\Vue\draw-and-guess> yarn 
yarn install v1.22.19
warning ..\..\package.json: No license field
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
warning "@vue/eslint-config-standard > eslint-import-resolver-webpack@0.12.2" has unmet peer dependency "webpack@>=1.11.0".
warning " > sass-loader@8.0.2" has unmet peer dependency "webpack@^4.36.0 || ^5.0.0".
[4/4] Building fresh packages...
[-/5] ⢀ waiting...
[-/5] ⢀ waiting...
[-/5] ⢀ waiting...
[-/5] ⢀ waiting...
error D:\Vue\draw-and-guess\node_modules\node-sass: Command failed.
Exit code: 1
Command: node scripts/build.js
Arguments: 
Directory: D:\Vue\draw-and-guess\node_modules\node-sass
Output:
Building: C:\Program Files\nodejs\node.exe D:\Vue\draw-and-guess\node_modules\node-gyp\bin\node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [
gyp verb cli   'C:\\Program Files\\nodejs\\node.exe',
gyp verb cli   'D:\\Vue\\draw-and-guess\\node_modules\\node-gyp\\bin\\node-gyp.js',
gyp verb cli   'rebuild',
gyp verb cli   '--verbose',
gyp verb cli   '--libsass_ext=',
gyp verb cli   '--libsass_cflags=',
gyp verb cli   '--libsass_ldflags=',
gyp verb cli   '--libsass_library='
gyp verb cli ]
gyp info using node-gyp@3.8.0
gyp info using node@18.6.0 | win32 | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb `which` failed Error: not found: python2
gyp verb `which` failed     at getNotFoundError (D:\Vue\draw-and-guess\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (D:\Vue\draw-and-guess\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (D:\Vue\draw-and-guess\node_modules\which\which.js:80:29)
gyp verb `which` failed     at D:\Vue\draw-and-guess\node_modules\which\which.js:89:16
gyp verb `which` failed     at D:\Vue\draw-and-guess\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at D:\Vue\draw-and-guess\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqCallback.oncomplete (node:fs:211:21)
gyp verb `which` failed  python2 Error: not found: python2
gyp verb `which` failed     at getNotFoundError (D:\Vue\draw-and-guess\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (D:\Vue\draw-and-guess\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (D:\Vue\draw-and-guess\node_modules\which\which.js:80:29)
gyp verb `which` failed     at D:\Vue\draw-and-guess\node_modules\which\which.js:89:16
gyp verb `which` failed     at D:\Vue\draw-and-guess\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at D:\Vue\draw-and-guess\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqCallback.oncomplete (node:fs:211:21) {
gyp verb `which` failed   code: 'ENOENT'
gyp verb `which` failed }
gyp verb check python checking for Python executable "python" in the PATH
gyp verb `which` failed Error: not found: python
gyp verb `which` failed     at getNotFoundError (D:\Vue\draw-and-guess\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (D:\Vue\draw-and-guess\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (D:\Vue\draw-and-guess\node_modules\which\which.js:80:29)
gyp verb `which` failed     at D:\Vue\draw-and-guess\node_modules\which\which.js:89:16
gyp verb `which` failed     at D:\Vue\draw-and-guess\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at D:\Vue\draw-and-guess\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqCallback.oncomplete (node:fs:211:21)
gyp verb `which` failed  python Error: not found: python
gyp verb `which` failed     at getNotFoundError (D:\Vue\draw-and-guess\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (D:\Vue\draw-and-guess\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (D:\Vue\draw-and-guess\node_modules\which\which.js:80:29)
gyp verb `which` failed     at D:\Vue\draw-and-guess\node_modules\which\which.js:89:16
gyp verb `which` failed     at D:\Vue\draw-and-guess\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at D:\Vue\draw-and-guess\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqCallback.oncomplete (node:fs:211:21) {
gyp verb `which` failed   code: 'ENOENT'
gyp verb `which` failed }
gyp verb could not find "python". checking python launcher
gyp verb could not find "python". guessing location
gyp verb ensuring that file exists: C:\Python27\python.exe
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack     at PythonFinder.failNoPython (D:\Vue\draw-and-guess\node_modules\node-gyp\lib\configure.js:484:19)
gyp ERR! stack     at PythonFinder.<anonymous> (D:\Vue\draw-and-guess\node_modules\node-gyp\lib\configure.js:509:16)
gyp ERR! stack     at callback (D:\Vue\draw-and-guess\node_modules\graceful-fs\polyfills.js:299:20)
gyp ERR! stack     at FSReqCallback.oncomplete (node:fs:211:21)
gyp ERR! System Windows_NT 10.0.22000
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "D:\\Vue\\draw-and-guess\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd D:\Vue\draw-and-guess\node_modules\node-sass
gyp ERR! node -v v18.6.0

解决方法:

将package.js中的

    // "node-sass": "^4.12.0",
    // "sass-loader": "^8.0.2",

换成
    "sass": "^1.49.8",
    "sass-loader": "^10.0.2",

Error: error:0308010C:digital envelope routines::unsupported

问题:

PS D:\Vue\draw-and-guess> yarn serve
yarn run v1.22.19
warning ..\..\package.json: No license field
$ vue-cli-service serve
 INFO  Starting development server...
10% building 2/4 modules 2 active D:\Vue\draw-and-guess\node_modules\webpack-dev-server\client\index.js?http://192.168.0.100:8080&sockPath=/sockjs-nodeError: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:71:19)
    at Object.createHash (node:crypto:133:10)
    at module.exports (D:\Vue\draw-and-guess\node_modules\webpack\lib\util\createHash.js:135:53)
    at NormalModule._initBuildHash (D:\Vue\draw-and-guess\node_modules\webpack\lib\NormalModule.js:417:16)
    at handleParseError (D:\Vue\draw-and-guess\node_modules\webpack\lib\NormalModule.js:471:10)
    at D:\Vue\draw-and-guess\node_modules\webpack\lib\NormalModule.js:503:5
    at D:\Vue\draw-and-guess\node_modules\webpack\lib\NormalModule.js:358:12
    at D:\Vue\draw-and-guess\node_modules\loader-runner\lib\LoaderRunner.js:373:3
    at iterateNormalLoaders (D:\Vue\draw-and-guess\node_modules\loader-runner\lib\LoaderRunner.js:214:10)
    at iterateNormalLoaders (D:\Vue\draw-and-guess\node_modules\loader-runner\lib\LoaderRunner.js:221:10)
    at D:\Vue\draw-and-guess\node_modules\loader-runner\lib\LoaderRunner.js:236:3
    at runSyncOrAsync (D:\Vue\draw-and-guess\node_modules\loader-runner\lib\LoaderRunner.js:130:11)
    at iterateNormalLoaders (D:\Vue\draw-and-guess\node_modules\loader-runner\lib\LoaderRunner.js:232:2)
    at Array.<anonymous> (D:\Vue\draw-and-guess\node_modules\loader-runner\lib\LoaderRunner.js:205:4)
    at Storage.finished (D:\Vue\draw-and-guess\node_modules\webpack\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:55:16)
    at D:\Vue\draw-and-guess\node_modules\webpack\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:91:9
10% building 2/5 modules 3 active ...de_modules\babel-loader\lib\index.js!D:\Vue\draw-and-guess\node_modules\eslint-loader\index.js??ref--13-0!D:\Vue\draw-and-guess\src\main.jsnode:internal/crypto/hash:71
  this[kHandle] = new _Hash(algorithm, xofLen);
                  ^

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:71:19)
    at Object.createHash (node:crypto:133:10)
    at module.exports (D:\Vue\draw-and-guess\node_modules\webpack\lib\util\createHash.js:135:53)
    at NormalModule._initBuildHash (D:\Vue\draw-and-guess\node_modules\webpack\lib\NormalModule.js:417:16)
    at handleParseError (D:\Vue\draw-and-guess\node_modules\webpack\lib\NormalModule.js:471:10)
    at D:\Vue\draw-and-guess\node_modules\webpack\lib\NormalModule.js:503:5
    at D:\Vue\draw-and-guess\node_modules\webpack\lib\NormalModule.js:358:12
    at D:\Vue\draw-and-guess\node_modules\loader-runner\lib\LoaderRunner.js:373:3
    at iterateNormalLoaders (D:\Vue\draw-and-guess\node_modules\loader-runner\lib\LoaderRunner.js:214:10)
    at Array.<anonymous> (D:\Vue\draw-and-guess\node_modules\loader-runner\lib\LoaderRunner.js:205:4)
    at Storage.finished (D:\Vue\draw-and-guess\node_modules\webpack\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:55:16)
    at D:\Vue\draw-and-guess\node_modules\webpack\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:91:9
    at D:\Vue\draw-and-guess\node_modules\graceful-fs\graceful-fs.js:123:16
    at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3) {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

Node.js v18.6.0
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

解决方法:

命令行运行:

$env:NODE_OPTIONS="--openssl-legacy-provider"

再次运行刚刚的命令
yarn serve 

(个人以实际为准)

问题解决:

 参考来自:

Error: error:0308010C:digital envelope routines::unsupportedicon-default.png?t=M666https://blog.csdn.net/Java_Rookie_Xiao/article/details/125534299
vue 项目初始化失败,npm install 失败: node_modules\node-sass: Command failed.icon-default.png?t=M666https://kylebing.blog.csdn.net/article/details/123071243?spm=1001.2014.3001.5506

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐