Quantcast
Channel: npm forum - Topics tagged triaged
Viewing all articles
Browse latest Browse all 30

Incorrect folder name for npm link gives unhelpful error

$
0
0

@dozenne wrote:

What I Wanted to Do

I was trying to do npm link to a local repo but mistyped the folder name. I would expect a sensible error message saying the folder doesn’t exist.

What Happened Instead

I got a useless error message that said “Error: Argument #2: Expected array but got string” and “This is an error with npm itself:”

Reproduction Steps

mkdir foo
cd foo
npm init -y
npm link ../bar

Details

0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'link',
1 verbose cli   '../bar' ]
2 info using npm@6.4.1
3 info using node@v8.12.0
4 verbose npm-session 2018c2eb8d5786f3
5 verbose stack Error: Argument #2: Expected array but got string
5 verbose stack     at EventEmitter.install (C:\Users\David\AppData\Roaming\nvm\v8.12.0\node_modules\npm\lib\install.js:190:3)
5 verbose stack     at Object.commandCache.(anonymous function) (C:\Users\David\AppData\Roaming\nvm\v8.12.0\node_modules\npm\lib\npm.js:159:13)
5 verbose stack     at C:\Users\David\AppData\Roaming\nvm\v8.12.0\node_modules\npm\lib\link.js:93:24
5 verbose stack     at C:\Users\David\AppData\Roaming\nvm\v8.12.0\node_modules\npm\node_modules\graceful-fs\polyfills.js:284:29
5 verbose stack     at FSReqWrap.oncomplete (fs.js:152:21)
6 verbose cwd C:\dev\npm-test
7 verbose Windows_NT 10.0.17134
8 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "link" "../bar"
9 verbose node v8.12.0
10 verbose npm  v6.4.1
11 error code EINVALIDTYPE
12 error typeerror Error: Argument #2: Expected array but got string
12 error typeerror     at EventEmitter.install (C:\Users\David\AppData\Roaming\nvm\v8.12.0\node_modules\npm\lib\install.js:190:3)
12 error typeerror     at Object.commandCache.(anonymous function) (C:\Users\David\AppData\Roaming\nvm\v8.12.0\node_modules\npm\lib\npm.js:159:13)
12 error typeerror     at C:\Users\David\AppData\Roaming\nvm\v8.12.0\node_modules\npm\lib\link.js:93:24
12 error typeerror     at C:\Users\David\AppData\Roaming\nvm\v8.12.0\node_modules\npm\node_modules\graceful-fs\polyfills.js:284:29
12 error typeerror     at FSReqWrap.oncomplete (fs.js:152: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

$ npm --versions
{ 'npm-test': '1.0.0',
  npm: '6.4.1',
  ares: '1.10.1-DEV',
  cldr: '32.0',
  http_parser: '2.8.0',
  icu: '60.1',
  modules: '57',
  napi: '3',
  nghttp2: '1.32.0',
  node: '8.12.0',
  openssl: '1.0.2p',
  tz: '2017c',
  unicode: '10.0',
  uv: '1.19.2',
  v8: '6.2.414.66',
  zlib: '1.2.11' }
$ node -p process.platform
win32

Posts: 9

Participants: 6

Read full topic


Viewing all articles
Browse latest Browse all 30

Trending Articles