Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
2675569545 opened this issue Nov 28, 2020 · 10 comments
Open

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

2675569545 opened this issue Nov 28, 2020 · 10 comments

Comments

@2675569545
Copy link

  各位大佬,我的是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 request/request#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 request/request#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' (hapijs/joi#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
Copy link

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

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

@2675569545
Copy link
Author

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

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

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

@caizhen0808
Copy link

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

@Grey132
Copy link

Grey132 commented Feb 24, 2021

解决了吗?

@sc-yan
Copy link

sc-yan commented Mar 9, 2021

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

@62019
Copy link

62019 commented Mar 31, 2021

正常!

@Przeblysk
Copy link

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

@markusriva
Copy link

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

用cnpm,谢谢问题解决了

@wmhello
Copy link

wmhello commented Aug 16, 2021 via email

@Tiper-In-Github
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants