我一直在尝试在 Mac 上使用 Gazebo 模拟器。我已经能够安装此处提到的先决条件:Mac 上的 Gazebo 安装
我只是无法安装 GazeboJs。当我在终端中使用以下命令时:npm install gazebojs --save
,我收到 npm 错误代码 1。我检查了其他具有类似标题的页面,并且还遵循了以下常规程序:
npm cache clean
npm install
但是,仍然得到同样的错误。这是错误输出:
npm ERR! code 1
npm ERR! path /Users/local/ardupilot_gazebo/build/ardupilot_gazebo/build/gz_node_inst/node_modules/gazebojs
npm ERR! command failed
npm ERR! command sh -c node-gyp rebuild
npm ERR! fs.js:45
npm ERR! } = primordials;
npm ERR! ^
npm ERR!
npm ERR! ReferenceError: primordials is not defined
npm ERR! at fs.js:45:5
npm ERR! at req_ (/Users/local/ardupilot_gazebo/build/ardupilot_gazebo/build/gz_node_inst/node_modules/natives/index.js:143:24)
npm ERR! at Object.req [as require] (/Users/local/ardupilot_gazebo/build/ardupilot_gazebo/build/gz_node_inst/node_modules/natives/index.js:55:10)
npm ERR! at Object.<anonymous> (/Users/local/ardupilot_gazebo/build/ardupilot_gazebo/build/gz_node_inst/node_modules/node-gyp/node_modules/graceful-fs/fs.js:1:37)
npm ERR! at Module._compile (internal/modules/cjs/loader.js:1068:30)
npm ERR! at Object.Module._extensions..js (internal/modules/cjs/loader.js:1097:10)
npm ERR! at Module.load (internal/modules/cjs/loader.js:933:32)
npm ERR! at Function.Module._load (internal/modules/cjs/loader.js:774:14)
npm ERR! at Module.require (internal/modules/cjs/loader.js:957:19)
npm ERR! at require (internal/modules/cjs/helpers.js:88:18)
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/local/.npm/_logs/2021-06-15T06_56_17_938Z-debug.log
感谢您的帮助!