PanJiaChen / vue-admin-template

a vue2.0 minimal admin template
https://git.io/fAnuM
MIT License
19.82k stars 7.39k forks source link

第一步npm install就无法通过 #642

Open 2675569545 opened 3 years ago

2675569545 commented 3 years ago

  各位大佬,我的是win10电脑,项目是刚刚从github下载的,在执行npm install发生了一些我找不到答案的问题。甚至还有一行乱码。我自己查询了一些资料,但是没有解决,我把我觉得有用的信息贴出来:我本地安装过vs2015,我尝试过npm install --global --production windows-build-tools再进行npm install。每次尝试都清空过node_modules和C:\Users\David\AppData\Local\npm-cache的文件夹。没有了办法,请教各位大佬。   错误信息如下:

F:\Coding\VSCode\VueStudy1\vue-admin-template-master>npm install 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 urix@0.1.0: Please see https://github.com/lydell/urix#deprecated npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated npm WARN deprecated har-validator@5.1.5: this library is no longer supported npm WARN deprecated request-promise-native@1.0.9: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142 npm WARN deprecated left-pad@1.3.0: use String.prototype.padStart() npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2. 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 @hapi/address@2.1.4: 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 request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142 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 @hapi/joi@15.1.1: joi is leaving the @hapi organization and moving back to 'joi' (https://github.com/sideway/joi/issues/2411) npm WARN deprecated core-js@2.6.12: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3. npm ERR! code 1 npm ERR! path F:\Coding\VSCode\VueStudy1\vue-admin-template-master\node_modules\bufferutil npm ERR! command failed npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node-gyp rebuild npm ERR! �ڴ˽��������һ������һ����Ŀ����Ҫ���ò������ɣ������ӡ�/m�����ء� npm ERR! bufferutil.c npm ERR! win_delay_load_hook.cc npm ERR! C:\Users\David.node-gyp\15.3.0\x64\node.lib : fatal error LNK1127: library is corrupt [F:\Coding\VSCode\VueStudy1\vue-admin-template-master\node_modules\bufferutil\build\bufferutil.vcxproj] 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@15.3.0 | win32 | x64 npm ERR! gyp info spawn F:\Python27\python.EXE npm ERR! gyp info spawn args [ npm ERR! gyp info spawn args 'F:\Coding\VSCode\VueStudy1\vue-admin-template-master\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 '-G', npm ERR! gyp info spawn args 'msvs_version=auto', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args 'F:\Coding\VSCode\VueStudy1\vue-admin-template-master\node_modules\bufferutil\build\config.gypi', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args 'F:\Coding\VSCode\VueStudy1\vue-admin-template-master\node_modules\node-gyp\addon.gypi', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args 'C:\Users\David\.node-gyp\15.3.0\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\David\.node-gyp\15.3.0', npm ERR! gyp info spawn args '-Dnode_gyp_dir=F:\Coding\VSCode\VueStudy1\vue-admin-template-master\node_modules\node-gyp', npm ERR! gyp info spawn args '-Dnode_lib_file=C:\Users\David\.node-gyp\15.3.0\<(target_arch)\node.lib', npm ERR! gyp info spawn args '-Dmodule_root_dir=F:\Coding\VSCode\VueStudy1\vue-admin-template-master\node_modules\bufferutil', 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 'F:\Coding\VSCode\VueStudy1\vue-admin-template-master\node_modules\bufferutil\build', npm ERR! gyp info spawn args '-Goutput_dir=.' npm ERR! gyp info spawn args ] npm ERR! gyp info spawn C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe npm ERR! gyp info spawn args [ npm ERR! gyp info spawn args 'build/binding.sln', npm ERR! gyp info spawn args '/clp:Verbosity=minimal', npm ERR! gyp info spawn args '/nologo', npm ERR! gyp info spawn args '/p:Configuration=Release;Platform=x64' npm ERR! gyp info spawn args ] npm ERR! gyp ERR! build error npm ERR! gyp ERR! stack Error: C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe failed with exit code: 1 npm ERR! gyp ERR! stack at ChildProcess.onExit (F:\Coding\VSCode\VueStudy1\vue-admin-template-master\node_modules\node-gyp\lib\build.js:262:23) npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:376:20) npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:277:12) npm ERR! gyp ERR! System Windows_NT 10.0.19041 npm ERR! gyp ERR! command "C:\Program Files\nodejs\node.exe" "F:\Coding\VSCode\VueStudy1\vue-admin-template-master\node_modules\node-gyp\bin\node-gyp.js" "rebuild" npm ERR! gyp ERR! cwd F:\Coding\VSCode\VueStudy1\vue-admin-template-master\node_modules\bufferutil npm ERR! gyp ERR! node -v v15.3.0 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\David\AppData\Local\npm-cache_logs\2020-11-28T15_46_49_567Z-debug.log

likwotsing commented 3 years ago

也是win10,安装了vs2017,使用了nvm,也遇到npm install就报错的情况,我是这么处理的,供参考。

  1. 手动删除node_modules目录
  2. npm cache clear --force
  3. npm install
2675569545 commented 3 years ago

也是win10,安装了vs2017,使用了nvm,也遇到npm install就报错的情况,我是这么处理的,供参考。

  1. 手动删除node_modules目录
  2. npm cache clear --force
  3. npm install

谢谢老哥的回复。我觉得你这个和我手动删除的操作差不多。不过我还是按照你说的试了一遍,但是还是不行。

caizhen0808 commented 3 years ago

npm 设置阿里(最好使用cnpm),把git cmd文件夹配置到电脑环境变量,再install就可以了

Grey132 commented 3 years ago

解决了吗?

sc-yan commented 3 years ago

大概率是源的问题。上面有解释,npm repo用国内的镜像。再就是如果本机装有python,可以把python删掉再试一下。

62019 commented 3 years ago

正常!

Przeblysk commented 3 years ago

国内因为网络的问题,npm intsall 很大几率会有失败的情况。很多人推荐使用taobao源,这是一种办法。还有就是直接用 yarn 来代替 npm 管理包。

markusriva commented 2 years ago

npm 设置阿里(最好使用cnpm),把git cmd文件夹配置到电脑环境变量,再install就可以了

用cnpm,谢谢问题解决了

wmhello commented 2 years ago

需要一对一的学习培训可以私聊我 微信号是xpyzwm

---原始邮件--- 发件人: @.> 发送时间: 2021年8月16日(周一) 上午9:08 收件人: @.>; 抄送: @.***>; 主题: Re: [PanJiaChen/vue-admin-template] 第一步npm install就无法通过 (#642)

npm 设置阿里(最好使用cnpm),把git cmd文件夹配置到电脑环境变量,再install就可以了

用cnpm,谢谢问题解决了

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

Tiper-In-Github commented 1 year ago

请看:https://gitee.com/wubie/vue2-element-admin-simplify 我这边解决了全部的依赖问题,以及和新版NodeJS不兼容的问题,你可以Clone我的仓库,然后解压“[backup]node_modules.zip”替换node_modules文件夹