issue with npm link when writing hubot adapter

What I Wanted to Do

Trying to work on a hubot adapter.

I expected npm link to work so i could fix the hubot adapter.

I was following these instructions: https://hubot.github.com/docs/adapters/development/

What Happened Instead

npm link failed.

Reproduction Steps

Cloned this repo : https://github.com/blazeu/hubot-facebook
Based on these instructions for hubot adapter development, fails at step 9(3?): https://hubot.github.com/docs/adapters/development/
It fails on the npm link command.

git clone https://github.com/blazeu/hubot-facebook
cd hubot-facebook && mkdir testbot
cd testbot && yo hubot 
npm link ../hubot-facebook

Details

$ cat /Users/david/.npm/_logs/2019-03-22T14_43_23_147Z-debug.log
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/Cellar/node/11.12.0/bin/node',
1 verbose cli   '/usr/local/bin/npm',
1 verbose cli   'link',
1 verbose cli   '../hubot-facebook' ]
2 info using npm@6.7.0
3 info using node@v11.12.0
4 verbose npm-session 113a8b6ca3606160
5 verbose stack Error: Argument #2: Expected array but got string
5 verbose stack     at EventEmitter.install (/usr/local/lib/node_modules/npm/lib/install.js:190:3)
5 verbose stack     at Object.commandCache.(anonymous function) (/usr/local/lib/node_modules/npm/lib/npm.js:156:13)
5 verbose stack     at /usr/local/lib/node_modules/npm/lib/link.js:93:24
5 verbose stack     at /usr/local/lib/node_modules/npm/node_modules/graceful-fs/polyfills.js:282:31
5 verbose stack     at FSReqCallback.oncomplete (fs.js:158:21)
6 verbose cwd /Users/david/Projects/Bots/hubot-facebook/testbot
7 verbose Darwin 18.2.0
8 verbose argv "/usr/local/Cellar/node/11.12.0/bin/node" "/usr/local/bin/npm" "link" "../hubot-facebook"
9 verbose node v11.12.0
10 verbose npm  v6.7.0
11 error code EINVALIDTYPE
12 error typeerror Error: Argument #2: Expected array but got string
12 error typeerror     at EventEmitter.install (/usr/local/lib/node_modules/npm/lib/install.js:190:3)
12 error typeerror     at Object.commandCache.(anonymous function) (/usr/local/lib/node_modules/npm/lib/npm.js:156:13)
12 error typeerror     at /usr/local/lib/node_modules/npm/lib/link.js:93:24
12 error typeerror     at /usr/local/lib/node_modules/npm/node_modules/graceful-fs/polyfills.js:282:31
12 error typeerror     at FSReqCallback.oncomplete (fs.js:158:21)
13 error typeerror This is an error with npm itself. Please report this error at:
13 error typeerror     <https://npm.community>
14 verbose exit [ 1, true ]

Platform Info

hubot-facebook $ npm --versions
{ 'hubot-facebook': '0.5.3',
  npm: '6.7.0',
  ares: '1.15.0',
  brotli: '1.0.7',
  cldr: '34.0',
  http_parser: '2.8.0',
  icu: '63.1',
  llhttp: '1.1.1',
  modules: '67',
  napi: '4',
  nghttp2: '1.34.0',
  node: '11.12.0',
  openssl: '1.1.1b',
  tz: '2018e',
  unicode: '11.0',
  uv: '1.26.0',
  v8: '7.0.276.38-node.18',
  zlib: '1.2.11' }

and the yeoman hubot sub directory:

testbot $ npm --versions                                                                                                                      
{ testbot: '0.0.0',
  npm: '6.7.0',
  ares: '1.15.0',
  brotli: '1.0.7',
  cldr: '34.0',
  http_parser: '2.8.0',
  icu: '63.1',
  llhttp: '1.1.1',
  modules: '67',
  napi: '4',
  nghttp2: '1.34.0',
  node: '11.12.0',
  openssl: '1.1.1b',
  tz: '2018e',
  unicode: '11.0',
  uv: '1.26.0',
  v8: '7.0.276.38-node.18',
  zlib: '1.2.11' }

$ node -p process.platform
darwin 

I don’t have a suggestion, but found a couple of topics with same error:

The ../hubot-sample part should be the relative path to the hubot-facebook directory, so in this case that would be ../:

npm link ../

You could also use the full path:

npm link /Users/david/Projects/Bots/hubot-facebook
1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.