我正在尝试在 Ubuntu 16.04 中安装 Terminal-Plus (Atom 插件)。所以我这样做:
sudo add-apt-repository ppa:webupd8team/atom
sudo apt-get update
sudo apt-get install atom
sudo apt-get install nodejs-legacy
sudo apt install npm
sudo npm install pty.js
sudo npm install npm -g
npm -v
返回:3.5.2。这样可以吗?
然后,我这样做:
sudo npm install -g node-gyp
sudo apm install fonts
然后,我这样做:
sudo apm install terminal-plus
我得到:
Installing terminal-plus to /home/me/.atom/packages ✗
> [email protected] install /tmp/apm-install-dir-116511-5876-r9x5dq/node_modules/terminal-plus/node_modules/pty.js
> (node-gyp rebuild 2> builderror.log) || (exit 0)
> [email protected] postinstall /tmp/apm-install-dir-116511-5876-r9x5dq/node_modules/terminal-plus/node_modules/pty.js
> node scripts/post-install.js
module.js:340
throw err;
^
Error: Cannot find module '/tmp/apm-install-dir-116511-5876-r9x5dq/node_modules/terminal-plus/node_modules/pty.js/scripts/post-install.js'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:935:3
npm ERR! Linux 4.4.0-22-generic
npm ERR! argv "/opt/atom/resources/app/apm/bin/node" "/opt/atom/resources/app/apm/node_modules/npm/bin/npm-cli.js" "--globalconfig" "/home/me/.atom/.apm/.apmrc" "--userconfig" "/home/me/.atom/.apmrc" "install" "/tmp/d-116511-5876-wgbgxq/package.tgz" "--target=0.36.8" "--arch=x64"
npm ERR! node v0.10.40
npm ERR! npm v2.13.3
npm ERR! code ELIFECYCLE
npm ERR! [email protected] postinstall: `node scripts/post-install.js`
npm ERR! Exit status 8
npm ERR!
npm ERR! Failed at the [email protected] postinstall script 'node scripts/post-install.js'.
npm ERR! This is most likely a problem with the pty.js package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node scripts/post-install.js
npm ERR! You can get their info via:
npm ERR! npm owner ls pty.js
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /tmp/apm-install-dir-116511-5876-r9x5dq/npm-debug.log
如何修复?我已经安装了pty.js
编辑2:
当删除sudo
前面的时sudo apm install fonts
,我得到:
apm install fonts
Installing fonts to /home/me/.atom/packages ✗
EACCES, rmdir '/home/me/.atom/packages/fonts'
同样适用于terminal-plus
:
apm install terminal-plus
Installing terminal-plus to /home/me/.atom/packages ✗
undefined
当删除sudo
前面的时npm install -g node-gyp
我得到:
:~$ npm install -g node-gyp
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/node-gyp
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules
/usr/local/lib
└── [email protected]
npm ERR! Linux 4.4.0-22-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/local/bin/npm" "install" "-g" "node-gyp"
npm ERR! node v4.2.6
npm ERR! npm v3.9.5
npm ERR! path /usr/local/lib/node_modules/node-gyp
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules/node-gyp'
npm ERR! at Error (native)
npm ERR! { [Error: EACCES: permission denied, access '/usr/local/lib/node_modules/node-gyp']
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/usr/local/lib/node_modules/node-gyp' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! Please include the following file with any support request:
npm ERR! /home/me/npm-debug.log
答案1
terminal-plus
不再维护,最后一次提交是在 2015 年 11 月。所以我建议切换到我的包,terminal-fusion
.terminal-fusion
是一个为 Linux 平台维护的终端包(仅适用于 Linux 平台,不适用于 macOS 或 Windows),我从中分叉而来platformio-ide-terminal
. 要安装它,请运行:
$ apm install terminal-fusion --no-confirm
其中$
表示用户控制台(所以不是以 root 身份运行此命令)。如果您遇到任何问题,terminal-fusion
请在其错误跟踪器上报告:这里。如果您想对我的软件包表示感谢,请用 APM 标记它:
$ apm star terminal-fusion
或使用 GitHub,请访问其存储库并按“星号”。
答案2
我通过安装 PlatformIO IDE 解决了这个问题,它是 Terminal Plus 的一个分支(显然 Terminal-plus 不再维护)。