hubotio / generator-hubot

Hubot generator for Yeoman
MIT License
155 stars 91 forks source link

Error Running Yo: npm ERR! not a package /tmp/npm-30929-OgybIFr-/github.com/RocketChat/asteroid.git #71

Closed richardwlu closed 7 years ago

richardwlu commented 8 years ago

When I run yo hubot as a non-root user, I am receiving the following error:

[richlu@chat r2z2-test3]$ yo hubot
                     _____________________________
                    /                             \
   //\              |      Extracting input for    |
  ////\    _____    |   self-replication process   |
 //////\  /_____\   \                             /
 ======= |[^_/\_]|   /----------------------------
  |   | _|___@@__|__
  +===+/  ///     \_\
   | |_\ /// HUBOT/\\
   |___/\//      /  \\
         \      /   +---+
          \____/    |   |
           | //|    +===+
            \//      |xx|

? Owner r2z2
? Bot name r2z2.api
? Description A simple helpful robot for your Company
? Bot adapter (campfire) rocketchatgot back false
? Bot adapter rocketchat
   create bin/hubot
   create bin/hubot.cmd
   create Procfile
   create README.md
   create external-scripts.json
   create hubot-scripts.json
   create .gitignore
   create package.json
   create scripts/example.coffee
   create .editorconfig
                     _____________________________
 _____              /                             \
 \    \             |   Self-replication process   |
 |    |    _____    |          complete...         |
 |__\\|   /_____\   \     Good luck with that.    /
   |//+  |[^_/\_]|   /----------------------------
  |   | _|___@@__|__
  +===+/  ///     \_\
   | |_\ /// HUBOT/\\
   |___/\//      /  \\
         \      /   +---+
          \____/    |   |
           | //|    +===+
            \//      |xx|

npm ERR! not a package /tmp/npm-30929-OgybIFr-/github.com/RocketChat/asteroid.git
npm ERR! Error: ENOENT, open '/tmp/npm-30929-OgybIFr-/github.com/RocketChat/asteroid.git-unpack/package.json'
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.10.0-327.el7.x86_64
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "hubot" "hubot-scripts" "hubot-diagnostics" "hubot-help" "hubot-heroku-keepalive" "hubot-google-images" "hubot-google-translate" "hubot-pugme" "hubot-maps" "hubot-redis-brain" "hubot-rules" "hubot-shipit" "hubot-rocketchat" "--save"
npm ERR! cwd /home/richlu/r2z2-test3
npm ERR! node -v v0.10.40
npm ERR! npm -v 1.4.28
npm ERR! path /tmp/npm-30929-OgybIFr-/github.com/RocketChat/asteroid.git-unpack/package.json
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! not ok code 0

My package.json turns out empty of dependencies. The last time I ran yo hubot, although a few months now, it was running fine. I had yo installed as root. When I try running yo hubot as root I receive:

[root@chat hubot-test]# yo hubot

Error: EACCES, permission denied '/root/.config'
    at Object.fs.mkdirSync (fs.js:654:18)
    at sync (/usr/local/lib/node_modules/yo/node_modules/mkdirp/index.js:71:13)
    at Function.sync (/usr/local/lib/node_modules/yo/node_modules/mkdirp/index.js:77:24)
    at Object.create.all.get (/usr/local/lib/node_modules/yo/node_modules/configstore/index.js:38:13)
    at Object.Configstore (/usr/local/lib/node_modules/yo/node_modules/configstore/index.js:27:44)
    at new Insight (/usr/local/lib/node_modules/yo/node_modules/insight/lib/index.js:37:34)
    at Object.<anonymous> (/usr/local/lib/node_modules/yo/lib/cli.js:130:11)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)

The file /root/.config doesn't exist. I am not sure if this is a relevant issue. I'm just trying to dig deeper and determine where this issue is coming from and would like some help.

richardwlu commented 8 years ago

It looks like the /tmp/npm-14425-3PWTo3x9/github.com/RocketChat/asteroid.git-unpack/package.json doesn't exist. Anyone have any idea why this would be?

digininja commented 7 years ago

Same problem here, as normal user:

? Owner User <user@example.com>
? Bot name myhubot
? Description A simple helpful robot for your Company
   create bin/hubot
   create bin/hubot.cmd
   create Procfile
   create README.md
   create external-scripts.json
   create hubot-scripts.json
   create .gitignore
   create package.json
   create scripts/example.coffee
   create .editorconfig
                     _____________________________
 _____              /                             \
 \    \             |   Self-replication process   |
 |    |    _____    |          complete...         |
 |__\\|   /_____\   \     Good luck with that.    /
   |//+  |[^_/\_]|   /----------------------------
  |   | _|___@@__|__
  +===+/  ///     \_\
   | |_\ /// HUBOT/\\
   |___/\//      /  \\
         \      /   +---+
          \____/    |   |
           | //|    +===+
            \//      |xx|

npm ERR! not a package /tmp/npm-4041-3HwzKCt_/github.com/RocketChat/asteroid.git
npm ERR! Error: ENOENT, open '/tmp/npm-4041-3HwzKCt_/github.com/RocketChat/asteroid.git-unpack/package.json'
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.10.0-327.36.1.el7.x86_64
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "hubot" "hubot-scripts" "hubot-diagnostics" "hubot-help" "hubot-heroku-keepalive" "hubot-google-images" "hubot-google-translate" "hubot-pugme" "hubot-maps" "hubot-redis-brain" "hubot-rules" "hubot-shipit" "hubot-rocketchat@1" "--save"
npm ERR! cwd /home/robin/myhubot
npm ERR! node -v v0.10.40
npm ERR! npm -v 1.4.28
npm ERR! path /tmp/npm-4041-3HwzKCt_/github.com/RocketChat/asteroid.git-unpack/package.json
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! not ok code 0

And as root:

# yo hubot --adapter="rocketchat@1"
Native thread-sleep not available.
This will result in much slower performance, but it will still work.
You should re-install spawn-sync or upgrade to the lastest version of node if possible.
Check /usr/local/lib/node_modules/yo/node_modules/yeoman-environment/node_modules/inquirer/node_modules/external-editor/node_modules/spawn-sync/error.log for more details
Native thread-sleep not available.
This will result in much slower performance, but it will still work.
You should re-install spawn-sync or upgrade to the lastest version of node if possible.
Check /usr/local/lib/node_modules/yo/node_modules/tabtab/node_modules/inquirer/node_modules/external-editor/node_modules/spawn-sync/error.log for more details

Error: EACCES, permission denied '/root/.config'
    at Object.fs.mkdirSync (fs.js:654:18)
    at sync (/usr/local/lib/node_modules/yo/node_modules/configstore/node_modules/mkdirp/index.js:71:13)
    at Function.sync (/usr/local/lib/node_modules/yo/node_modules/configstore/node_modules/mkdirp/index.js:77:24)
    at Object.create.all.get (/usr/local/lib/node_modules/yo/node_modules/configstore/index.js:38:13)
    at Object.Configstore (/usr/local/lib/node_modules/yo/node_modules/configstore/index.js:27:44)
    at new Insight (/usr/local/lib/node_modules/yo/node_modules/insight/lib/index.js:37:34)
    at Object.<anonymous> (/usr/local/lib/node_modules/yo/lib/cli.js:172:11)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
[root@localhost myhubot]# 

This is a fresh CentOS install with the software all being installed by following the Github Readme.

digininja commented 7 years ago

Just tried making /root/.config and setting it world writable to see what would happen, it still fails but in a different way:

[root@localhost myhubot]# yo hubot --adapter="rocketchat@1"
Native thread-sleep not available.
This will result in much slower performance, but it will still work.
You should re-install spawn-sync or upgrade to the lastest version of node if possible.
Check /usr/local/lib/node_modules/yo/node_modules/yeoman-environment/node_modules/inquirer/node_modules/external-editor/node_modules/spawn-sync/error.log for more details
Native thread-sleep not available.
This will result in much slower performance, but it will still work.
You should re-install spawn-sync or upgrade to the lastest version of node if possible.
Check /usr/local/lib/node_modules/yo/node_modules/tabtab/node_modules/inquirer/node_modules/external-editor/node_modules/spawn-sync/error.log for more details
? ==========================================================================
We're constantly looking for ways to make yo better! 
May we anonymously report usage statistics to improve the tool over time? 
More info: https://github.com/yeoman/insight & http://yeoman.io
========================================================================== No
                     _____________________________  
                    /                             \ 
   //\              |      Extracting input for    |
  ////\    _____    |   self-replication process   |
 //////\  /_____\   \                             / 
 ======= |[^_/\_]|   /----------------------------  
  |   | _|___@@__|__                                
  +===+/  ///     \_\                               
   | |_\ /// HUBOT/\\                             
   |___/\//      /  \\                            
         \      /   +---+                            
          \____/    |   |                            
           | //|    +===+                            
            \//      |xx|                            

? Owner User <user@example.com>
? Bot name myhubot
? Description A simple helpful robot for your Company

/usr/local/lib/node_modules/generator-hubot/node_modules/yeoman-generator/node_modules/mkdirp/index.js:90
                    throw err0;
                          ^
Error: EACCES, permission denied '/root/myhubot/bin'
    at Object.fs.mkdirSync (fs.js:654:18)
    at Function.sync (/usr/local/lib/node_modules/generator-hubot/node_modules/yeoman-generator/node_modules/mkdirp/index.js:71:13)
    at yeoman.generators.Base.extend.writing.app (/usr/local/lib/node_modules/generator-hubot/generators/app/index.js:246:12)
    at /usr/local/lib/node_modules/generator-hubot/node_modules/yeoman-generator/lib/base.js:395:14
    at processImmediate [as _immediateCallback] (timers.js:363:15)
stale[bot] commented 7 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.