Error with npm link command and npm 6.9.0

What I Wanted to Do

npm link a local module

What Happened Instead

The following error popup all of a sudden

npm ERR! code EINVALIDTYPE
npm ERR! typeerror Error: Argument #2: Expected array but got string
npm ERR! typeerror     at EventEmitter.install (/Users/acordier/.nvm/versions/node/v10.16.0/lib/node_modules/npm/lib/install.js:190:3)
npm ERR! typeerror     at Object.commandCache.(anonymous function) (/Users/acordier/.nvm/versions/node/v10.16.0/lib/node_modules/npm/lib/npm.js:156:13)
npm ERR! typeerror     at /Users/acordier/.nvm/versions/node/v10.16.0/lib/node_modules/npm/lib/link.js:93:24
npm ERR! typeerror     at /Users/acordier/.nvm/versions/node/v10.16.0/lib/node_modules/npm/node_modules/graceful-fs/polyfills.js:282:31
npm ERR! typeerror     at FSReqWrap.oncomplete (fs.js:153:21)
npm ERR! typeerror This is an error with npm itself. Please report this error at:
npm ERR! typeerror     <https://npm.community>

Reproduction Steps

Using npm 6.9.0 on mac os 10.14.6

rm -rf node_modules
npm ci
npm link ../<existing node module locally installed>

Details

This does not append with the npm version that ships with node 12.* (6.10.2)

Platform Info

$ npm --versions
6.9.0
$ node -p process.platform
darwin

The same error has been reported with it being due to a mistyped folder name for the link target (and an unhelpful error message):

Damn you’re right, there was a typo in my folder name. Sorry and thank you !

1 Like

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