简体   繁体   English

每次我尝试运行 NPM 安装终端都会抛出几个错误

[英]Everytime I Try To Run NPM Install Terminal throws several errors

This is on my work laptop.这是在我的工作笔记本电脑上。 I have Latest version of angular, Nodejs, Nodesass, VScode and mentioned them in Local environment path as well.我有 angular、Nodejs、Nodesass、VScode 的最新版本,并且在本地环境路径中也提到了它们。 If I download any Angular template from Github and Try to do NPM Install and it throws these error always.如果我从 Github 下载任何 Angular 模板并尝试执行 NPM 安装,它总是会抛出这些错误。 What shall I do to fix these error?我该怎么做才能修复这些错误?

//        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:\Interview\node_modules\which\which.js:13:12)
//        gyp verb `which` failed     at F (D:\Interview\node_modules\which\which.js:68:19)
//        gyp verb `which` failed     at E (D:\Interview\node_modules\which\which.js:80:29)
//        gyp verb `which` failed     at D:\Interview\node_modules\which\which.js:89:16
//        gyp verb `which` failed     at D:\Interview\node_modules\isexe\index.js:42:5
//        gyp verb `which` failed     at D:\Interview\node_modules\isexe\windows.js:36:5
//        gyp verb `which` failed     at FSReqCallback.oncomplete (node:fs:199:21)
//        gyp verb `which` failed  python2 Error: not found: python2
//        gyp verb `which` failed     at getNotFoundError (D:\Interview\node_modules\which\which.js:13:12)
//        gyp verb `which` failed     at F (D:\Interview\node_modules\which\which.js:68:19)
//        gyp verb `which` failed     at E (D:\Interview\node_modules\which\which.js:80:29)
//        gyp verb `which` failed     at D:\Interview\node_modules\which\which.js:89:16
//        gyp verb `which` failed     at D:\Interview\node_modules\isexe\index.js:42:5
//        gyp verb `which` failed     at D:\Interview\node_modules\isexe\windows.js:36:5
//        gyp verb `which` failed     at FSReqCallback.oncomplete (node:fs:199: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` succeeded python C:\Program Files (x86)\Python38-32\python.EXE
//        gyp ERR! configure error 
//        gyp ERR! stack Error: Command failed: C:\Program Files (x86)\Python38-32\python.EXE -c import sys; print "%s.%s.%s" % sys.version_info[:3];       
//        gyp ERR! stack   File "<string>", line 1
//        gyp ERR! stack     import sys; print "%s.%s.%s" % sys.version_info[:3];
//        gyp ERR! stack                       ^
//        gyp ERR! stack SyntaxError: invalid syntax
//        gyp ERR! stack 
//        gyp ERR! stack     at ChildProcess.exithandler (node:child_process:333:12)
//        gyp ERR! stack     at ChildProcess.emit (node:events:376:20)
//        gyp ERR! stack     at maybeClose (node:internal/child_process:1063:16)
//        gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:295:5)
//        gyp ERR! System Windows_NT 10.0.18363
//        gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "D:\\Interview\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
//        gyp ERR! cwd D:\Interview\node_modules\node-sass
//        gyp ERR! node -v v15.5.1
//        gyp ERR! node-gyp -v v3.8.0
//        gyp ERR! not ok
//        Build failed with error code: 1       
//        npm ERR! code ELIFECYCLE
//        npm ERR! errno 1
//        npm ERR! node-sass@4.14.1 postinstall: `node scripts/build.js`
//        npm ERR! Exit status 1
//        npm ERR!
//        npm ERR! Failed at the node-sass@4.14.1 postinstall script.
//        npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

I think you are using Windows for development.我认为您正在使用 Windows 进行开发。 Some node.js modules required to build locally on a machine.一些 node.js 模块需要在机器上本地构建。 so, that why it needs python version 2.x and other tools.所以,这就是为什么它需要 python 版本 2.x 和其他工具。

windows-build-tools package install required tools to build module locally. windows-build-tools package 安装所需的工具以在本地构建模块。 Go ahead and install this package and after installing it then try again running the command npm install command Go 提前安装此 package 并在安装后再次尝试运行命令 npm 安装命令

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 npm 安装在反应项目中抛出一堆错误 - npm install throws a bunch of errors in react project 当我运行“npm install”命令时,没有安装任何东西,我在终端中得到一个空的新行 - When I run "npm install" commands nothing installs and I get an empty new line in my terminal 每当我尝试在 Visual Studio 代码上运行“npm install”时出现错误 - I get an error whenever i try to run "npm install" on visual studio code 当我运行“npm install”时,我的终端上出现此错误消息“npm ERR。Linux 5.4.72-microsoft-standard-WSL2” - I have this error message "npm ERR! Linux 5.4.72-microsoft-standard-WSL2" on my terminal when I run "npm install" ReactJS npm 运行构建引发 elifecycle 和导出错误(奇怪) - ReactJS npm run build throws elifecycle & export errors (weird) 尝试在JavaScript中运行多个for循环以填充图表信息,但会出错 - Try to run several for loops in javascript to fill in info for a chart but getting errors 如果每次运行 npm 安装时它都会更改,那么 package-lock.json 有什么用? - For what use is the package-lock.json if it changes everytime you run npm install? npm install 和 npm run dev 控制台抛出错误后,即使项目在另一台机器上工作 - after npm install and npm run dev console throws error, even though project works on another machine npm 从终端安装错误 - npm install error from the terminal 当我不小心在终端中运行时,'npm un dev' 是什么? - what is 'npm un dev' as i accidently run in my terminal?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM