开发者社区> 问答> 正文

ubuntu下安装 hexo失败

执行 sudo npm install hexo -g时 报错
贴上报错

 npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian
> dtrace-provider@0.6.0 install /usr/local/lib/node_modules/hexo/node_modules/hexo-log/node_modules/bunyan/node_modules/dtrace-provider
> node scripts/install.js
sh: 1: node: not found
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian
npm WARN optional dep failed, continuing dtrace-provider@0.6.0
npm ERR! error rolling back Error: ENOTEMPTY, rmdir '/usr/local/lib/node_modules/hexo/node_modules/cheerio/node_modules/jsdom/node_modules/cssstyle/lib/properties'
npm ERR! error rolling back  hexo@3.2.0 { [Error: ENOTEMPTY, rmdir '/usr/local/lib/node_modules/hexo/node_modules/cheerio/node_modules/jsdom/node_modules/cssstyle/lib/properties']
npm ERR! error rolling back   errno: 53,
npm ERR! error rolling back   code: 'ENOTEMPTY',
npm ERR! error rolling back   path: '/usr/local/lib/node_modules/hexo/node_modules/cheerio/node_modules/jsdom/node_modules/cssstyle/lib/properties' }
npm ERR! spawn-sync@1.0.15 postinstall: `node postinstall`
npm ERR! Exit status 127
npm ERR! 
npm ERR! Failed at the spawn-sync@1.0.15 postinstall script.
npm ERR! This is most likely a problem with the spawn-sync package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node postinstall
npm ERR! You can get their info via:
npm ERR!     npm owner ls spawn-sync
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 3.19.0-51-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "hexo" "-g"
npm ERR! cwd /home/sjd/code
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.4.21
npm ERR! code ELIFECYCLE
npm ERR! Error: ENOENT, open '/usr/local/lib/node_modules/hexo/node_modules/cheerio/node_modules/jsdom/node_modules/request/node_modules/hawk/lib/server.js'
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR!     <http://github.com/npm/npm/issues>

npm ERR! System Linux 3.19.0-51-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "hexo" "-g"
npm ERR! cwd /home/sjd/code
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.4.21
npm ERR! path /usr/local/lib/node_modules/hexo/node_modules/cheerio/node_modules/jsdom/node_modules/request/node_modules/hawk/lib/server.js
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! EEXIST, mkdir '/usr/local/lib/node_modules/hexo/node_modules/warehouse/node_modules/cuid/node_modules/core-js/library/fn/symbol'
File exists: /usr/local/lib/node_modules/hexo/node_modules/warehouse/node_modules/cuid/node_modules/core-js/library/fn/symbol
Move it away, and try again. 
npm ERR! System Linux 3.19.0-51-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "hexo" "-g"
npm ERR! cwd /home/sjd/code
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.4.21
npm ERR! path /usr/local/lib/node_modules/hexo/node_modules/warehouse/node_modules/cuid/node_modules/core-js/library/fn/symbol
npm ERR! fstream_path /usr/local/lib/node_modules/hexo/node_modules/warehouse/node_modules/cuid/node_modules/core-js/library/fn/symbol/iterator.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code EEXIST
npm ERR! errno 47
npm ERR! fstream_stack /usr/lib/nodejs/fstream/lib/writer.js:171:23
npm ERR! fstream_stack /usr/lib/nodejs/mkdirp/index.js:46:53
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm ERR! Error: ENOENT, lstat '/usr/local/lib/node_modules/hexo/node_modules/cheerio/node_modules/jsdom/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/LICENSE'
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR!     <http://github.com/npm/npm/issues>
npm ERR! System Linux 3.19.0-51-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "hexo" "-g"
npm ERR! cwd /home/sjd/code
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.4.21
npm ERR! path /usr/local/lib/node_modules/hexo/node_modules/cheerio/node_modules/jsdom/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/LICENSE
npm ERR! fstream_path /usr/local/lib/node_modules/hexo/node_modules/cheerio/node_modules/jsdom/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/LICENSE
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /usr/lib/nodejs/fstream/lib/writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (evalmachine.<anonymous>:107:15)
npm ERR! Error: ENOENT, lstat '/usr/local/lib/node_modules/hexo/node_modules/cheerio/node_modules/jsdom/node_modules/request/node_modules/form-data/node_modules/async/lib/async.js'
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR!     <http://github.com/npm/npm/issues>
npm ERR! System Linux 3.19.0-51-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "hexo" "-g"
npm ERR! cwd /home/sjd/code
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.4.21
npm ERR! path /usr/local/lib/node_modules/hexo/node_modules/cheerio/node_modules/jsdom/node_modules/request/node_modules/form-data/node_modules/async/lib/async.js
npm ERR! fstream_path /usr/local/lib/node_modules/hexo/node_modules/cheerio/node_modules/jsdom/node_modules/request/node_modules/form-data/node_modules/async/lib/async.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /usr/lib/nodejs/fstream/lib/writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (evalmachine.<anonymous>:107:15)
npm ERR! Error: ENOENT, lstat '/usr/local/lib/node_modules/hexo/node_modules/cheerio/node_modules/jsdom/node_modules/request/node_modules/bl/node_modules/readable-stream/doc/stream.markdown'
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR!     <http://github.com/npm/npm/issues>

展开
收起
杨冬芳 2016-07-18 10:26:48 3891 0
1 条回答
写回答
取消 提交回答
  • 码农|Coder| Pythonista

    看你来是你装的node版本有问题,建议你装LTS版本

    2019-07-17 19:57:34
    赞同 展开评论 打赏
问答分类:
问答标签:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
Ghost Telephonist 立即下载
低代码开发师(初级)实战教程 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载