Javascript atom编辑器:节点gyp重建崩溃

Javascript atom编辑器:节点gyp重建崩溃,javascript,python,node.js,node-gyp,atom-editor,Javascript,Python,Node.js,Node Gyp,Atom Editor,我正在尝试安装一个使用node gyp的atom包。但每次都会崩溃 以下是apm输出: Installing autocomplete-clang to /home/lars/.atom/packages ✗ > runas@1.0.1 install /tmp/apm-install-dir-11499-22706-1lgjxbx/node_modules/autocomplete-clang/node_modules/clang-flags/node_modules/pathwatc

我正在尝试安装一个使用node gyp的atom包。但每次都会崩溃

以下是apm输出:

Installing autocomplete-clang to /home/lars/.atom/packages ✗

> runas@1.0.1 install /tmp/apm-install-dir-11499-22706-1lgjxbx/node_modules/autocomplete-clang/node_modules/clang-flags/node_modules/pathwatcher/node_modules/runas
> node-gyp rebuild


> runas@0.5.4 install /tmp/apm-install-dir-11499-22706-1lgjxbx/node_modules/autocomplete-clang/node_modules/snippets/node_modules/pathwatcher/node_modules/runas
> node-gyp rebuild


npm http GET https://registry.npmjs.org/underscore-plus
npm http GET https://registry.npmjs.org/clang-flags
npm http 304 https://registry.npmjs.org/underscore-plus
npm http 304 https://registry.npmjs.org/clang-flags
npm http GET https://registry.npmjs.org/underscore
npm http GET https://registry.npmjs.org/pathwatcher
npm http GET https://registry.npmjs.org/async
npm http GET https://registry.npmjs.org/emissary
npm http GET https://registry.npmjs.org/loophole
npm http GET https://registry.npmjs.org/fs-plus
npm http GET https://registry.npmjs.org/pathwatcher
npm http GET https://registry.npmjs.org/pegjs
npm http GET https://registry.npmjs.org/season
npm http GET https://registry.npmjs.org/temp
npm http 304 https://registry.npmjs.org/underscore
npm http 304 https://registry.npmjs.org/fs-plus
npm http 304 https://registry.npmjs.org/async
npm http 304 https://registry.npmjs.org/pegjs
npm http 304 https://registry.npmjs.org/season
npm http 304 https://registry.npmjs.org/pathwatcher
npm http 304 https://registry.npmjs.org/pathwatcher
npm http GET https://registry.npmjs.org/emissary
npm http GET https://registry.npmjs.org/event-kit
npm http 304 https://registry.npmjs.org/temp
npm http GET https://registry.npmjs.org/nan/1.2.0
npm http GET https://registry.npmjs.org/grim
npm http GET https://registry.npmjs.org/q
npm http GET https://registry.npmjs.org/runas
npm http 304 https://registry.npmjs.org/emissary
npm http 304 https://registry.npmjs.org/emissary
npm http 304 https://registry.npmjs.org/nan/1.2.0
npm http 304 https://registry.npmjs.org/q
npm http 304 https://registry.npmjs.org/runas
npm http 304 https://registry.npmjs.org/grim
npm http 304 https://registry.npmjs.org/event-kit
npm http GET https://registry.npmjs.org/mkdirp
npm http GET https://registry.npmjs.org/rimraf
gyp ERR! configure error 
gyp ERR! stack Error: EACCES, mkdir '/tmp/apm-install-dir-11499-22706-1lgjxbx/node_modules/autocomplete-clang/node_modules/clang-flags/node_modules/pathwatcher/node_modules/runas/build'
gyp ERR! System Linux 3.13.0-36-generic
gyp ERR! command "node" "/usr/local/share/atom/resources/app/apm/node_modules/atom-package-manager/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /tmp/apm-install-dir-11499-22706-1lgjxbx/node_modules/autocomplete-clang/node_modules/clang-flags/node_modules/pathwatcher/node_modules/runas
gyp ERR! node -v v0.10.26
gyp ERR! node-gyp -v v0.12.2
gyp ERR! not ok 
npm http GET https://registry.npmjs.org/mixto
npm http GET https://registry.npmjs.org/property-accessors
npm http 304 https://registry.npmjs.org/rimraf
npm http 304 https://registry.npmjs.org/mkdirp
npm http 304 https://registry.npmjs.org/loophole
npm ERR! runas@1.0.1 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the runas@1.0.1 install script.
npm ERR! This is most likely a problem with the runas package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls runas
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 3.13.0-36-generic
npm ERR! command "/usr/local/share/atom/resources/app/apm/node_modules/atom-package-manager/bin/node" "/usr/local/share/atom/resources/app/apm/node_modules/atom-package-manager/node_modules/npm/bin/npm-cli.js" "--globalconfig" "/usr/local/share/atom/resources/app/apm/node_modules/atom-package-manager/.apmrc" "--userconfig" "/home/lars/.atom/.apmrc" "install" "/home/lars/.atom/.node-gyp/.atom/.apm/autocomplete-clang/0.2.0/package.tgz" "--target=0.11.10" "--arch=x64"
npm ERR! cwd /tmp/apm-install-dir-11499-22706-1lgjxbx
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.4
npm ERR! code ELIFECYCLE
npm http 304 https://registry.npmjs.org/property-accessors
npm http GET https://registry.npmjs.org/coffee-script
npm http GET https://registry.npmjs.org/optimist
npm http GET https://registry.npmjs.org/osenv/0.0.3
npm http GET https://registry.npmjs.org/bindings
npm http GET https://registry.npmjs.org/nan/0.8.0
npm http 304 https://registry.npmjs.org/osenv/0.0.3
npm http GET https://registry.npmjs.org/graceful-fs
npm http 200 https://registry.npmjs.org/optimist
npm http 304 https://registry.npmjs.org/bindings
npm http 304 https://registry.npmjs.org/graceful-fs
npm http 304 https://registry.npmjs.org/coffee-script
npm http GET https://registry.npmjs.org/wordwrap
npm http 304 https://registry.npmjs.org/nan/0.8.0
gyp ERR! configure error 
gyp ERR! stack Error: EACCES, mkdir '/tmp/apm-install-dir-11499-22706-1lgjxbx/node_modules/autocomplete-clang/node_modules/snippets/node_modules/pathwatcher/node_modules/runas/build'
gyp ERR! System Linux 3.13.0-36-generic
gyp ERR! command "node" "/usr/local/share/atom/resources/app/apm/node_modules/atom-package-manager/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /tmp/apm-install-dir-11499-22706-1lgjxbx/node_modules/autocomplete-clang/node_modules/snippets/node_modules/pathwatcher/node_modules/runas
gyp ERR! node -v v0.10.26
gyp ERR! node-gyp -v v0.12.2
gyp ERR! not ok 
npm http 304 https://registry.npmjs.org/wordwrap
npm http 304 https://registry.npmjs.org/mixto
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /tmp/apm-install-dir-11499-22706-1lgjxbx/npm-debug.log
npm ERR! not ok code 0
网上有很多帖子描述了这个问题或类似的行为。显然,节点gyp有点问题

  • 它似乎依赖于python 2.6()
  • 并在某些版本的nodejs()中产生问题
起初,我的python版本是2.7。这就是我所做的:

  • 我删除了atom和NodeJ,并重新安装了它们的最新版本(源代码中的NodeJ)。错误仍然存在
  • 我用npm安装了节点gyp和runas。错误仍然存在
  • 我从chris lea ppa中删除了所有内容并安装了它。错误依然存在
  • 我删除了所有内容,添加了deadsnakes ppa,将python设置为旧的2.6版本,并检查了终端中的python命令运行的版本—its 2.6。然后我从源代码重新安装了nodejs。使用npm配置将python路径设置为2.6。并重新安装了节点gyp。错误仍然存在
  • 我删除了所有内容,除了旧的python设置。并从chris lea ppa安装了NodeJ。同样的问题
  • 我删除了~/.atom/.node gyp/,并用npm重新安装了它
  • 在每一步之间,我都会清理npm缓存并重新安装最新版本的atom

    我的atom packages目录中的节点gyp重建每次都失败。而且我无法安装自动完成程序包。同样的错误。 错误消息表明运行方式有问题。因此,在每个步骤中,我还通过npm安装了runas

    这真的是浪费了很多时间,我已经没有主意了

    更新:


    使用最新版本的atom,我无法再现错误

    使用最新版本的atom,我无法再现此错误

    在Mac上,我通过查找
    apm
    的安装位置(在我的机器MacOSX上:
    /Applications/Atom.app/Contents/Resources/app/apm/bin
    ),然后在该文件夹中运行:
    /apm config set python/usr/bin/python2.7
    ,解决了这个问题。此命令为随atom安装的
    apm
    程序设置python配置,并且不会干扰全局节点设置。或为了方便复制/粘贴:

    cd /Applications/Atom.app/Contents/Resources/app/apm/bin
    ./apm config set python /usr/bin/python2.7