Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] npm link ../doesnt-exist gives EINVALIDTYPE #535

Closed
FauxFaux opened this issue Nov 28, 2019 · 1 comment
Closed

[BUG] npm link ../doesnt-exist gives EINVALIDTYPE #535

FauxFaux opened this issue Nov 28, 2019 · 1 comment
Labels
Bug thing that needs fixing

Comments

@FauxFaux
Copy link

What / Why

npm link ../doesnt-exist, which is completely invalid syntax, gives a weird error:

npm ERR! code EINVALIDTYPE
npm ERR! typeerror Error: Argument #2: Expected array but got string
npm ERR! typeerror     at EventEmitter.install (/home/faux/.npm-packages/lib/node_modules/npm/lib/install.js:195:3)
npm ERR! typeerror     at Object.commandCache.(anonymous function) (/home/faux/.npm-packages/lib/node_modules/npm/lib/npm.js:156:13)
npm ERR! typeerror     at /home/faux/.npm-packages/lib/node_modules/npm/lib/link.js:93:24
npm ERR! typeerror     at callback (/home/faux/.npm-packages/lib/node_modules/npm/node_modules/graceful-fs/polyfills.js:295:20)
npm ERR! typeerror     at FSReqWrap.oncomplete (fs.js:153:21)

When

Always, even outside a project, target path is valid or not, etc.
I do have linked projects on my system, and a registry, and a cache, and a prefix.

//registry.npmjs.org/:_authToken=${NPM_TOKEN}
cache=/home/faux/.cache/npm
prefix=/home/faux/.npm-packages

Expected Behavior

I had remembered that this was the syntax to link the module at a path. It is not.
I don't even think it should be. I just happened to run it.

I meant to run:

cd ../doesnt-exist
npm link
cd -
npm link doesnt-exist

Log

0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node',
1 verbose cli   '/home/faux/.npm-packages/bin/npm',
1 verbose cli   'link',
1 verbose cli   '../doesnt-exist' ]
2 info using npm@6.13.1
3 info using node@v10.16.3
4 verbose npm-session 71d8617c042c4a73
5 verbose stack Error: Argument #2: Expected array but got string
5 verbose stack     at EventEmitter.install (/home/faux/.npm-packages/lib/node_modules/npm/lib/install.js:195:3)
5 verbose stack     at Object.commandCache.(anonymous function) (/home/faux/.npm-packages/lib/node_modules/npm/lib/npm.js:156:13)
5 verbose stack     at /home/faux/.npm-packages/lib/node_modules/npm/lib/link.js:93:24
5 verbose stack     at callback (/home/faux/.npm-packages/lib/node_modules/npm/node_modules/graceful-fs/polyfills.js:295:20)
5 verbose stack     at FSReqWrap.oncomplete (fs.js:153:21)
6 verbose cwd /var/tmp/faux191128.omelette
7 verbose Linux 5.3.0-23-generic
8 verbose argv "/usr/bin/node" "/home/faux/.npm-packages/bin/npm" "link" "../doesnt-exist"
9 verbose node v10.16.3
10 verbose npm  v6.13.1
@darcyclarke darcyclarke added the Bug thing that needs fixing label Oct 30, 2020
@darcyclarke
Copy link
Contributor

npm v6 is no longer in active development; We will continue to push security releases to v6 at our team's discretion as-per our Support Policy.

If your bug is preproducible on v7, please re-file this issue using our new issue template.

If your issue was a feature request, please consider opening a new RRFC or RFC. If your issue was a question or other idea that was not CLI-specific, consider opening a discussion on our feedback repo

Closing: This is an automated message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing
Projects
None yet
Development

No branches or pull requests

2 participants