搜索

首页  >  问答  >  正文

无法在laravel vue项目中执行npm安装

<p>我正在为我的 <strong>laravel vue 项目</strong>执行<strong>npm install</strong>。但 npm install 显示以下错误:</p> <pre class="brush:php;toolbar:false;">gyp verb find Python Python is not set from command line or npm configuration gyp verb find Python Python is not set from environment variable PYTHON gyp verb find Python checking if &quot;python3&quot; can be used gyp verb find Python - executing &quot;python3&quot; to get executable path gyp verb find Python - &quot;python3&quot; is not in PATH or produced an error gyp verb find Python checking if &quot;python&quot; can be used gyp verb find Python - executing &quot;python&quot; to get executable path gyp verb find Python - &quot;python&quot; is not in PATH or produced an error gyp verb find Python checking if &quot;python2&quot; can be used gyp verb find Python - executing &quot;python2&quot; to get executable path gyp verb find Python - &quot;python2&quot; is not in PATH or produced an error gyp verb find Python checking if Python is C:\Python37\python.exe gyp verb find Python - executing &quot;C:\Python37\python.exe&quot; to get version gyp verb find Python - &quot;C:\Python37\python.exe&quot; could not be run gyp verb find Python checking if Python is C:\Python27\python.exe gyp verb find Python - executing &quot;C:\Python27\python.exe&quot; to get version gyp verb find Python - &quot;C:\Python27\python.exe&quot; could not be run gyp verb find Python checking if the py launcher can be used to find Python gyp verb find Python - executing &quot;py.exe&quot; to get Python executable path gyp verb find Python - &quot;py.exe&quot; is not in PATH or produced an error gyp ERR! find Python gyp ERR! find Python Python is not set from command line or npm configuration gyp ERR! find Python Python is not set from environment variable PYTHON gyp ERR! find Python checking if &quot;python3&quot; can be used gyp ERR! find Python - &quot;python3&quot; is not in PATH or produced an error gyp ERR! find Python checking if &quot;python&quot; can be used gyp ERR! find Python - &quot;python&quot; is not in PATH or produced an error gyp ERR! find Python checking if &quot;python2&quot; can be used gyp ERR! find Python - &quot;python2&quot; is not in PATH or produced an error gyp ERR! find Python checking if Python is C:\Python37\python.exe gyp ERR! find Python - &quot;C:\Python37\python.exe&quot; could not be run gyp ERR! find Python checking if Python is C:\Python27\python.exe gyp ERR! find Python - &quot;C:\Python27\python.exe&quot; could not be run gyp ERR! find Python checking if the py launcher can be used to find Python gyp ERR! find Python - &quot;py.exe&quot; is not in PATH or produced an error gyp ERR! find Python gyp ERR! find Python ********************************************************** gyp ERR! find Python You need to install the latest version of Python. gyp ERR! find Python Node-gyp should be able to find and use Python. If not, gyp ERR! find Python you can try one of the following options: gyp ERR! find Python - Use the switch --python=&quot;C:\Path\To\python.exe&quot; gyp ERR! find Python (accepted by both node-gyp and npm) gyp ERR! find Python - Set the environment variable PYTHON gyp ERR! find Python - Set the npm configuration variable python: gyp ERR! find Python npm config set python &quot;C:\Path\To\python.exe&quot; gyp ERR! find Python For more information consult the documentation at: gyp ERR! find Python https://github.com/nodejs/node-gyp#installation gyp ERR! find Python ********************************************************** gyp ERR! find Python gyp ERR! configure error gyp ERR! stack Error: Could not find any Python installation to use gyp ERR! stack at PythonFinder.fail (D:\Projects\Quadque-Tech-Server\node_modules\node-gyp\lib\find-python.js:302:47) gyp ERR! stack at PythonFinder.runChecks (D:\Projects\Quadque-Tech-Server\node_modules\node-gyp\lib\find-python.js:136:21) gyp ERR! stack at PythonFinder.<anonymous> (D:\Projects\Quadque-Tech-Server\node_modules\node-gyp\lib\find-python.js:200:18) gyp ERR! stack at PythonFinder.execFileCallback (D:\Projects\Quadque-Tech-Server\node_modules\node-gyp\lib\find-python.js:266:16) gyp ERR! stack at exithandler (node:child_process:420:5) gyp ERR! stack at ChildProcess.errorhandler (node:child_process:432:5) gyp ERR! stack at ChildProcess.emit (node:events:513:28) gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:289:12) gyp ERR! stack at onErrorNT (node:internal/child_process:476:16) gyp ERR! stack at process.processTicksAndRejections (node:internal/process/task_queues:82:21) gyp ERR! System Windows_NT 10.0.19044 gyp ERR! command &quot;C:\\Program Files\\nodejs\\node.exe&quot; &quot;D:\\Projects\\Quadque-Tech-Server\\node_modules\\node-gyp\\bin\\node-gyp.js&quot; &quot;rebuild&quot; &quot;--verbose&quot; &quot;--libsass_ext=&quot; &quot;--libsass_cflags=&quot; &quot;--libsass_ldflags=&quot; &quot;--libsass_library=&quot; gyp ERR! cwd D:\Projects\Quadque-Tech-Server\node_modules\node-sass gyp ERR! node -v v18.12.1 gyp ERR! node-gyp -v v7.1.2 gyp ERR! not ok Build failed with error code: 1 npm WARN acorn-import-assertions@1.8.0 requires a peer of acorn@^8 but none is installed. You must install peer dependencies yourself. npm WARN prosemirror-utils@0.9.6 requires a peer of prosemirror-tables@^0.9.1 but none is installed. You must install peer dependencies yourself. npm WARN css-loader@1.0.1 requires a peer of webpack@^4.0.0 but none is installed. You must install peer dependencies yourself. npm WARN file-loader@2.0.0 requires a peer of webpack@^2.0.0 || ^3.0.0 || ^4.0.0 but none is installed. You must install peer dependencies yourself. npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.2 (node_modules\chokidar\node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {&quot;os&quot;:&quot;darwin&quot;,&quot;arch&quot;:&quot;any&quot;} (current: {&quot;os&quot;:&quot;win32&quot;,&quot;arch&quot;:&quot;x64&quot;}) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! node-sass@6.0.1 postinstall: `node scripts/build.js` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the node-sass@6.0.1 postinstall script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\Tanjib\AppData\Roaming\npm-cache\_logs\2023-01-08T15_14_38_129Z-debug.log</pre> <p><strong>注意:我使用纱线安装了一些东西,然后就发生了这种情况。我以前没有用过纱线。我想我搞砸了一些事情。</strong> 它总是显示 python 错误。为什么 ? 我卸载并重新安装了node.js。但错误就是不去。帮助。</p>
P粉566048790P粉566048790459 天前456

全部回复(1)我来回复

  • P粉225961749

    P粉2259617492023-08-31 14:28:22

    这意味着您的系统上尚未安装 Python 3.x,或者 Python 的安装二进制文件夹不在您的 PATH 中。 Python 的安装程序应该能够将其安装文件夹添加到您的 PATH 环境变量中。

    如果您安装了 Python,但仍然遇到此错误,请执行以下步骤:

    1. 右键单击开始菜单,转到系统
    2. 点击高级系统设置
    3. 点击环境变量
    4. 选择 PATH 并单击“编辑...”
    5. 单击“新建”并将 Python 的安装二进制文件夹添加到列表中。

    回复
    0
  • 取消回复