npm download报错
来源:8-1 使用qiankun重构项目
def_myself
2022-01-15
安装依赖报错:
npm ERR! code 1
npm ERR! path E:\vscode_codes\微前端\video-code\main\node_modules\node-sass
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node-gyp rebuild
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@7.1.2
npm ERR! gyp info using node@16.13.1 | win32 | x64
npm ERR! gyp info find Python using Python version 3.10.1 found at "C:\Python310\python.exe"
npm ERR! gyp http GET https://nodejs.org/download/release/v16.13.1/node-v16.13.1-headers.tar.gz
npm ERR! gyp http 200 https://nodejs.org/download/release/v16.13.1/node-v16.13.1-headers.tar.gz
npm ERR! gyp http GET https://nodejs.org/download/release/v16.13.1/SHASUMS256.txt
npm ERR! gyp http GET https://nodejs.org/download/release/v16.13.1/win-x86/node.lib
npm ERR! gyp http GET https://nodejs.org/download/release/v16.13.1/win-x64/node.lib
npm ERR! gyp http GET https://nodejs.org/download/release/v16.13.1/win-arm64/node.lib
npm ERR! gyp http 404 https://nodejs.org/download/release/v16.13.1/win-arm64/node.lib
npm ERR! gyp http 200 https://nodejs.org/download/release/v16.13.1/SHASUMS256.txt
npm ERR! gyp http 200 https://nodejs.org/download/release/v16.13.1/win-x86/node.lib
npm ERR! gyp http 200 https://nodejs.org/download/release/v16.13.1/win-x64/node.lib
npm ERR! gyp info find VS using VS2019 (16.11.31911.196) found at:
npm ERR! gyp info find VS "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools"
npm ERR! gyp info find VS run with --verbose for detailed information
npm ERR! (node:8284) [DEP0150] DeprecationWarning: Setting process.config is deprecated. In the future the property will be read-only.
npm ERR! (Use `node --trace-deprecation ...` to show where the warning was created)
npm ERR! gyp info spawn C:\Python310\python.exe
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args 'E:\\vscode_codes\\微前端\\video-code\\main\\node_modules\\node-gyp\\gyp\\gyp_main.py',
npm ERR! gyp info spawn args 'binding.gyp',
npm ERR! gyp info spawn args '-f',
npm ERR! gyp info spawn args 'msvs',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args 'E:\\vscode_codes\\微前端\\video-code\\main\\node_modules\\node-sass\\build\\config.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args 'E:\\vscode_codes\\微前端\\video-code\\main\\node_modules\\node-gyp\\addon.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args 'C:\\Users\\js\\AppData\\Local\\node-gyp\\Cache\\16.13.1\\include\\node\\common.gypi',
npm ERR! gyp info spawn args '-Dlibrary=shared_library',
npm ERR! gyp info spawn args '-Dvisibility=default',
npm ERR! gyp info spawn args '-Dnode_root_dir=C:\\Users\\js\\AppData\\Local\\node-gyp\\Cache\\16.13.1',
npm ERR! gyp info spawn args '-Dnode_gyp_dir=E:\\vscode_codes\\微前端\\video-code\\main\\node_modules\\node-gyp',
npm ERR! gyp info spawn args '-Dnode_lib_file=C:\\\\Users\\\\js\\\\AppData\\\\Local\\\\node-gyp\\\\Cache\\\\16.13.1\\\\<(target_arch)\\\\node.lib',
npm ERR! gyp info spawn args '-Dmodule_root_dir=E:\\vscode_codes\\微前端\\video-code\\main\\node_modules\\node-sass',
npm ERR! gyp info spawn args '-Dnode_engine=v8',
npm ERR! gyp info spawn args '--depth=.',
npm ERR! gyp info spawn args '--no-parallel',
npm ERR! gyp info spawn args '--generator-output',
npm ERR! gyp info spawn args 'E:\\vscode_codes\\微前端\\video-code\\main\\node_modules\\node-sass\\build',
npm ERR! gyp info spawn args '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! Traceback (most recent call last):
npm ERR! File "E:\vscode_codes\ǰ��\video-code\main\node_modules\node-gyp\gyp\gyp_main.py", line 51, in <module>
npm ERR! sys.exit(gyp.script_main())
npm ERR! File "E:\vscode_codes\ǰ��\video-code\main\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 670, in script_main
npm ERR! return main(sys.argv[1:])
npm ERR! File "E:\vscode_codes\ǰ��\video-code\main\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 662, in main
npm ERR! return gyp_main(args)
npm ERR! File "E:\vscode_codes\ǰ��\video-code\main\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 629, in gyp_main
npm ERR! [generator, flat_list, targets, data] = Load(
npm ERR! File "E:\vscode_codes\ǰ��\video-code\main\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 150, in Load
npm ERR! result = gyp.input.Load(
npm ERR! File "E:\vscode_codes\ǰ��\video-code\main\node_modules\node-gyp\gyp\pylib\gyp\input.py", line 3021, in Load
npm ERR! LoadTargetBuildFile(
npm ERR! File "E:\vscode_codes\ǰ��\video-code\main\node_modules\node-gyp\gyp\pylib\gyp\input.py", line 411, in LoadTargetBuildFile
npm ERR! build_file_data = LoadOneBuildFile(
npm ERR! File "E:\vscode_codes\ǰ��\video-code\main\node_modules\node-gyp\gyp\pylib\gyp\input.py", line 266, in LoadOneBuildFile
npm ERR! LoadBuildFileIncludesIntoDict(
npm ERR! File "E:\vscode_codes\ǰ��\video-code\main\node_modules\node-gyp\gyp\pylib\gyp\input.py", line 310, in LoadBuildFileIncludesIntoDict
npm ERR! LoadOneBuildFile(include, data, aux_data, None, False, check),
npm ERR! File "E:\vscode_codes\ǰ��\video-code\main\node_modules\node-gyp\gyp\pylib\gyp\input.py", line 239, in LoadOneBuildFile
npm ERR! build_file_contents = open(build_file_path, "rU").read()
npm ERR! UnicodeDecodeError: 'gbk' codec can't decode byte 0xae in position 12913: illegal multibyte sequence
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: `gyp` failed with exit code: 1
npm ERR! gyp ERR! stack at ChildProcess.onCpExit (E:\vscode_codes\微前端\video-code\main\node_modules\node-gyp\lib\configure.js:351:16)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:390:28)
npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
npm ERR! gyp ERR! System Windows_NT 10.0.19042
npm ERR! gyp ERR! command "E:\\NodeJS\\v16.13.1\\node.exe" "E:\\vscode_codes\\微前端\\video-code\\main\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd E:\vscode_codes\微前端\video-code\main\node_modules\node-sass
npm ERR! gyp ERR! node -v v16.13.1
npm ERR! gyp ERR! node-gyp -v v7.1.2
npm ERR! gyp ERR! not ok
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\js\AppData\Local\npm-cache\_logs\2022-01-14T18_20_36_937Z-debug.log
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: react16@1.0.0
npm ERR! Found: node-sass@5.0.0
npm ERR! node_modules/node-sass
npm ERR! node-sass@"^5.0.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer node-sass@"^4.0.0" from sass-loader@6.0.7
npm ERR! node_modules/sass-loader
npm ERR! sass-loader@"^6.0.7" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See C:\Users\js\AppData\Local\npm-cache\eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\js\AppData\Local\npm-cache\_logs\2022-01-14T18_20_40_779Z-debug.log
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: react16@1.0.0
npm ERR! Found: react@17.0.2
npm ERR! node_modules/react
npm ERR! react@"^17.0.0-rc.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^0.14.0 || ^15.0.0 || ^16.0.0-rc" from react-router@3.2.0
npm ERR! node_modules/react-router
npm ERR! dev react-router@"3.2.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See C:\Users\js\AppData\Local\npm-cache\eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\js\AppData\Local\npm-cache\_logs\2022-01-14T18_20_46_230Z-debug.log
npm WARN deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated @hapi/bourne@1.3.2: 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 eslint-loader@2.2.1: This loader has been deprecated. Please use eslint-webpack-plugin
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated html-webpack-plugin@3.2.0: 3.x is no longer supported
npm WARN deprecated @hapi/address@2.1.4: Moved to 'npm install @sideway/address'
npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
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 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 request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
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 svgo@1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x.
npm WARN deprecated tar@2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.
npm ERR! code 1
npm ERR! path E:\vscode_codes\微前端\video-code\vue2\node_modules\node-sass
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node-gyp rebuild
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@3.8.0
npm ERR! gyp info using node@16.13.1 | win32 | x64
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Command failed: C:\Python310\python.EXE -c import sys; print "%s.%s.%s" % sys.version_info[:3];
npm ERR! gyp ERR! stack File "<string>", line 1
npm ERR! gyp ERR! stack import sys; print "%s.%s.%s" % sys.version_info[:3];
npm ERR! gyp ERR! stack ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
npm ERR! gyp ERR! stack SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
npm ERR! gyp ERR! stack
npm ERR! gyp ERR! stack at ChildProcess.exithandler (node:child_process:397:12)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:390:28)
npm ERR! gyp ERR! stack at maybeClose (node:internal/child_process:1064:16)
npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
npm ERR! gyp ERR! System Windows_NT 10.0.19042
npm ERR! gyp ERR! command "E:\\NodeJS\\v16.13.1\\node.exe" "E:\\vscode_codes\\微前端\\video-code\\vue2\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd E:\vscode_codes\微前端\video-code\vue2\node_modules\node-sass
npm ERR! gyp ERR! node -v v16.13.1
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\js\AppData\Local\npm-cache\_logs\2022-01-14T18_21_33_919Z-debug.log
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: vue3@0.1.0
npm ERR! Found: webpack@4.46.0
npm ERR! node_modules/webpack
npm ERR! webpack@"^4.0.0" from @vue/cli-plugin-babel@4.5.13
npm ERR! node_modules/@vue/cli-plugin-babel
npm ERR! dev @vue/cli-plugin-babel@"~4.5.0" from the root project
npm ERR! webpack@"^4.0.0" from @vue/cli-service@4.5.13
npm ERR! node_modules/@vue/cli-service
npm ERR! dev @vue/cli-service@"~4.5.0" from the root project
npm ERR! peer @vue/cli-service@"^3.0.0 || ^4.0.0-0" from @vue/cli-plugin-babel@4.5.13
npm ERR! node_modules/@vue/cli-plugin-babel
npm ERR! dev @vue/cli-plugin-babel@"~4.5.0" from the root project
npm ERR! 1 more (@vue/cli-plugin-eslint)
npm ERR! 6 more (@vue/cli-plugin-eslint, babel-loader, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! dev vue-loader@"^15.9.3" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: webpack@5.66.0
npm ERR! node_modules/webpack
npm ERR! peer webpack@"^5.0.0" from css-loader@6.5.1
npm ERR! node_modules/css-loader
npm ERR! peer css-loader@"*" from vue-loader@15.9.8
npm ERR! node_modules/vue-loader
npm ERR! dev vue-loader@"^15.9.3" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See C:\Users\js\AppData\Local\npm-cache\eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\js\AppData\Local\npm-cache\_logs\2022-01-14T18_21_42_433Z-debug.log
2回答
-
TimoHo
2022-07-03
大概率是 node-sass 的原因,执行 node -v,使用 node 13 版本试一下。
00 -
yancy
2022-01-15
重新安装一下依赖
00
相似问题