会飞的蚊子 發表於 2021-3-16 11:29:00

yarn start 启动项目报错 Command failed. Exit code: 127 Command: node build.js || nodejs build.js

<p>&nbsp;</p>
<div class="cnblogs_code">
<p>error /Users/admin/Desktop/workspace/xxxxx/xx/xxxx/task-platform1/node_modules/fibers: Command failed.<br>Exit code: 127<br>Command: node build.js || nodejs build.js<br>Arguments: <br>Directory: /Users/admin/Desktop/workspace/xxxxx/xx/xxxx/task-platform1/node_modules/fibers<br>Output:<br>gyp info it worked if it ends with ok<br>gyp info using node-gyp@5.1.0<br>gyp info using node@14.15.5 | darwin | x64<br>gyp info find Python using Python version 2.7.16 found at "/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python"<br>gyp info spawn /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python<br>gyp info spawn args [<br>gyp info spawn args   '/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',<br>gyp info spawn args   'binding.gyp',<br>gyp info spawn args   '-f',<br>gyp info spawn args   'make',<br>gyp info spawn args   '-I',<br>gyp info spawn args   '/Users/admin/Desktop/workspace/xxxxxx/xxx/xxxxx/task-platform1/node_modules/fibers/build/config.gypi',<br>gyp info spawn args   '-I',<br>gyp info spawn args   '/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',<br>gyp info spawn args   '-I',<br>gyp info spawn args   '/Users/admin/Library/Caches/node-gyp/14.15.5/include/node/common.gypi',<br>gyp info spawn args   '-Dlibrary=shared_library',<br>gyp info spawn args   '-Dvisibility=default',<br>gyp info spawn args   '-Dnode_root_dir=/Users/admin/Library/Caches/node-gyp/14.15.5',<br>gyp info spawn args   '-Dnode_gyp_dir=/usr/local/lib/node_modules/npm/node_modules/node-gyp',<br>gyp info spawn args   '-Dnode_lib_file=/Users/admin/Library/Caches/node-gyp/14.15.5/&lt;(target_arch)/node.lib',<br>gyp info spawn args   '-Dmodule_root_dir=/Users/admin/Desktop/workspace/xxxxx/xx/xxxx/task-platform1/node_modules/fibers',<br>gyp info spawn args   '-Dnode_engine=v8',<br>gyp info spawn args   '--depth=.',<br>gyp info spawn args   '--no-parallel',<br>gyp info spawn args   '--generator-output',<br>gyp info spawn args   'build',<br>gyp info spawn args   '-Goutput_dir=.'<br>gyp info spawn args ]<br>No receipt for 'com.apple.pkg.CLTools_Executables' found at '/'.</p>
<p>No receipt for 'com.apple.pkg.DeveloperToolsCLILeo' found at '/'.</p>
<p>No receipt for 'com.apple.pkg.DeveloperToolsCLI' found at '/'.</p>
<p>gyp: No Xcode or CLT version detected!<br>gyp ERR! configure error <br>gyp ERR! stack Error: `gyp` failed with exit code: 1<br>gyp ERR! stack   at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)<br>gyp ERR! stack   at ChildProcess.emit (events.js:315:20)<br>gyp ERR! stack   at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)<br>gyp ERR! System Darwin 19.6.0<br>gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--release"<br>gyp ERR! cwd /Users/admin/Desktop/workspace/xxxxx/xxx/xxxxx/task-platform1/node_modules/fibers<br>gyp ERR! node -v v14.15.5<br>gyp ERR! node-gyp -v v5.1.0<br>gyp ERR! not ok <br>node-gyp exited with code: 1<br>Please make sure you are using a supported platform and node version. If you<br>would like to compile fibers on this machine please make sure you have setup your<br>build environment--<br>Windows + OS X instructions here: https://github.com/nodejs/node-gyp<br>Ubuntu users please run: `sudo apt-get install g++ build-essential`</p>
<p>&nbsp;</p>
<p><br>error Command failed with exit code 127.<br>info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.</p>
</div>
<p>解决方案:</p>
<div class="cnblogs_code">
<pre><span style="color: rgba(128, 0, 128, 1)">2</span>. Install Python <span style="color: rgba(128, 0, 128, 1)">2.7</span><span style="color: rgba(0, 0, 0, 1)">, and add it to your PATH

</span><span style="color: rgba(128, 0, 128, 1)">3</span>. npm config <span style="color: rgba(0, 0, 255, 1)">set</span> python python2.<span style="color: rgba(128, 0, 128, 1)">7</span> --<span style="color: rgba(0, 0, 255, 1)">global</span>

<span style="color: rgba(128, 0, 128, 1)">4</span>. npm config <span style="color: rgba(0, 0, 255, 1)">set</span> python C:\Python27\python.exe --<span style="color: rgba(0, 0, 255, 1)">global</span>

<span style="color: rgba(128, 0, 128, 1)">5</span>. npm config <span style="color: rgba(0, 0, 255, 1)">set</span> msvs_version <span style="color: rgba(128, 0, 128, 1)">2015</span> --<span style="color: rgba(0, 0, 255, 1)">global</span></pre>
</div>
<p>重启电脑再打开</p>

</div>
<div id="MySignature" role="contentinfo">
    不积跬步无以至千里<br><br>
来源:https://www.cnblogs.com/lyt0207/p/14542547.html
頁: [1]
查看完整版本: yarn start 启动项目报错 Command failed. Exit code: 127 Command: node build.js || nodejs build.js