项目依赖包node-sass安装失败

报错
npm ERR! path C:\Users\lenovo\Desktop\oceanus.bi-main\ui\node_modules\node-sass
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node scripts/build.js
npm ERR! Building: C:\Program Files\nodejs\node.exe C:\Users\lenovo\Desktop\oceanus.bi-main\ui\node_modules\node-gyp\bin\node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
npm ERR! �ڴ˽��������һ������һ����Ŀ����Ҫ���ò������ɣ������ӡ�/m�����ء�
npm ERR! ��������ʱ��Ϊ 2022/5/7 17:31:08��
npm ERR! MSBUILD : error MSB4132: �޷�ʶ�𹤾߰汾��2.0�������õĹ��߰汾Ϊ "4.0"��
npm ERR!
npm ERR! ����ʧ�ܡ�
npm ERR!
npm ERR!   MSBUILD : error MSB4132: �޷�ʶ�𹤾߰汾��2.0�������õĹ��߰汾Ϊ "4.0"��
npm ERR!
npm ERR!     0 ������
npm ERR!     1 ������
npm ERR!
npm ERR! ����ʱ�� 00:00:00.18
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp verb cli [
npm ERR! gyp verb cli   'C:\\Program Files\\nodejs\\node.exe',
npm ERR! gyp verb cli   'C:\\Users\\lenovo\\Desktop\\oceanus.bi-main\\ui\\node_modules\\node-gyp\\bin\\node-gyp.js',
npm ERR! gyp verb cli   'rebuild',
npm ERR! gyp verb cli   '--verbose',
npm ERR! gyp verb cli   '--libsass_ext=',
npm ERR! gyp verb cli   '--libsass_cflags=',
npm ERR! gyp verb cli   '--libsass_ldflags=',
npm ERR! gyp verb cli   '--libsass_library='
npm ERR! gyp verb cli ]
npm ERR! gyp info using node-gyp@3.8.0
npm ERR! gyp info using node@16.14.2 | win32 | x64
npm ERR! gyp verb command rebuild []
npm ERR! gyp verb command clean []
npm ERR! gyp verb clean removing "build" directory
npm ERR! gyp verb command configure []
npm ERR! gyp verb check python checking for Python executable "python2.7" in the PATH
npm ERR! gyp verb `which` failed Error: not found: python2.7
npm ERR! gyp verb `which` failed     at getNotFoundError (C:\Users\lenovo\Desktop\oceanus.bi-main\ui\node_modules\which\which.js:13:12)
npm ERR! gyp verb `which` failed     at F (C:\Users\lenovo\Desktop\oceanus.bi-main\ui\node_modules\which\which.js:68:19)
npm ERR! gyp verb `which` failed     at E (C:\Users\lenovo\Desktop\oceanus.bi-main\ui\node_modules\which\which.js:80:29)
npm ERR! gyp verb `which` failed     at C:\Users\lenovo\Desktop\oceanus.bi-main\ui\node_modules\which\which.js:89:16
npm ERR! gyp verb `which` failed     at C:\Users\lenovo\Desktop\oceanus.bi-main\ui\node_modules\isexe\index.js:42:5
npm ERR! gyp verb `which` failed     at C:\Users\lenovo\Desktop\oceanus.bi-main\ui\node_modules\isexe\windows.js:36:5
npm ERR! gyp verb `which` failed     at FSReqCallback.oncomplete (node:fs:198:21)
npm ERR! gyp verb `which` failed  python2.7 Error: not found: python2.7
npm ERR! gyp verb `which` failed     at getNotFoundError (C:\Users\lenovo\Desktop\oceanus.bi-main\ui\node_modules\which\which.js:13:12)
npm ERR! gyp verb `which` failed     at F (C:\Users\lenovo\Desktop\oceanus.bi-main\ui\node_modules\which\which.js:68:19)
npm ERR! gyp verb `which` failed     at E (C:\Users\lenovo\Desktop\oceanus.bi-main\ui\node_modules\which\which.js:80:29)
npm ERR! gyp verb `which` failed     at C:\Users\lenovo\Desktop\oceanus.bi-main\ui\node_modules\which\which.js:89:16
npm ERR! gyp verb `which` failed     at C:\Users\lenovo\Desktop\oceanus.bi-main\ui\node_modules\isexe\index.js:42:5
npm ERR! gyp verb `which` failed     at C:\Users\lenovo\Desktop\oceanus.bi-main\ui\node_modules\isexe\windows.js:36:5
npm ERR! gyp verb `which` failed     at FSReqCallback.oncomplete (node:fs:198:21) {
npm ERR! gyp verb `which` failed   code: 'ENOENT'
npm ERR! gyp verb `which` failed }
npm ERR! gyp verb could not find "python2.7". checking python launcher
npm ERR! gyp verb check python launcher python executable found: "C:\\Python27\\python.exe"
npm ERR! gyp verb check python version `C:\Python27\python.exe -c "import sys; print "2.7.0
npm ERR! gyp verb check python version .%s.%s" % sys.version_info[:3];"` returned: %j
npm ERR! gyp verb get node dir no --target version specified, falling back to host node version: 16.14.2
npm ERR! gyp verb command install [ '16.14.2' ]
npm ERR! gyp verb install input version string "16.14.2"
npm ERR! gyp verb install installing version: 16.14.2
npm ERR! gyp verb install --ensure was passed, so won't reinstall if already installed
npm ERR! gyp verb install version is already installed, need to check "installVersion"
npm ERR! gyp verb got "installVersion" 9
npm ERR! gyp verb needs "installVersion" 9
npm ERR! gyp verb install version is good
npm ERR! gyp verb get node dir target node version installed: 16.14.2
npm ERR! gyp verb build dir attempting to create "build" dir: C:\Users\lenovo\Desktop\oceanus.bi-main\ui\node_modules\node-sass\build
npm ERR! gyp verb build dir "build" dir needed to be created? C:\Users\lenovo\Desktop\oceanus.bi-main\ui\node_modules\node-sass\build
npm ERR! gyp verb Not using VS2017: Could not use PowerShell to find VS2017
npm ERR! gyp verb build/config.gypi creating config file
npm ERR! gyp verb build/config.gypi writing out config file: C:\Users\lenovo\Desktop\oceanus.bi-main\ui\node_modules\node-sass\build\config.gypi
npm ERR! (node:17588) [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 verb config.gypi checking for gypi file: C:\Users\lenovo\Desktop\oceanus.bi-main\ui\node_modules\node-sass\config.gypi
npm ERR! gyp verb common.gypi checking for gypi file: C:\Users\lenovo\Desktop\oceanus.bi-main\ui\node_modules\node-sass\common.gypi
npm ERR! gyp verb gyp gyp format was not specified; forcing "msvs"
npm ERR! gyp info spawn C:\Python27\python.exe
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   'C:\\Users\\lenovo\\Desktop\\oceanus.bi-main\\ui\\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   'C:\\Users\\lenovo\\Desktop\\oceanus.bi-main\\ui\\node_modules\\node-sass\\build\\config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   'C:\\Users\\lenovo\\Desktop\\oceanus.bi-main\\ui\\node_modules\\node-gyp\\addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   'C:\\Users\\lenovo\\.node-gyp\\16.14.2\\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\\lenovo\\.node-gyp\\16.14.2',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=C:\\Users\\lenovo\\Desktop\\oceanus.bi-main\\ui\\node_modules\\node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=C:\\Users\\lenovo\\.node-gyp\\16.14.2\\<(target_arch)\\node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=C:\\Users\\lenovo\\Desktop\\oceanus.bi-main\\ui\\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   'C:\\Users\\lenovo\\Desktop\\oceanus.bi-main\\ui\\node_modules\\node-sass\\build',
npm ERR! gyp info spawn args ]
npm ERR! Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
npm ERR! Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
npm ERR! Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
npm ERR! Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
npm ERR! gyp verb command build []
npm ERR! gyp verb build type Release
npm ERR! gyp verb architecture x64
npm ERR! gyp verb node dev dir C:\Users\lenovo\.node-gyp\16.14.2
npm ERR! gyp verb found first Solution file build/binding.sln
npm ERR! gyp verb could not find "msbuild.exe" in PATH - finding location in registry
npm ERR! gyp info spawn C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   'build/binding.sln',
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:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe` failed with exit code: 1
npm ERR! gyp ERR! stack     at ChildProcess.onExit (C:\Users\lenovo\Desktop\oceanus.bi-main\ui\node_modules\node-gyp\lib\build.js:262:23)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:526:28)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
npm ERR! gyp ERR! System Windows_NT 10.0.19044
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\lenovo\\Desktop\\oceanus.bi-main\\ui\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
npm ERR! gyp ERR! cwd C:\Users\lenovo\Desktop\oceanus.bi-main\ui\node_modules\node-sass
npm ERR! gyp ERR! node -v v16.14.2
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok
npm ERR! Build failed with error code: 1

这个是由于python环境变量安装有问题

重新安装了python2.7版本

配置了环境变量

然后就好了

https://blog.csdn.net/qq_43225030/article/details/106612859

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 193,968评论 5 459
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 81,682评论 2 371
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 141,254评论 0 319
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 52,074评论 1 263
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 60,964评论 4 355
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 46,055评论 1 272
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 36,484评论 3 381
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 35,170评论 0 253
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 39,433评论 1 290
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 34,512评论 2 308
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 36,296评论 1 325
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 32,184评论 3 312
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 37,545评论 3 298
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 28,880评论 0 17
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 30,150评论 1 250
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 41,437评论 2 341
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 40,630评论 2 335

推荐阅读更多精彩内容