我按照here编写了nodejs和npm,但在安装了这两个之后,npm不起作用。总是我尝试运行任何命令,如npm -v
,npm version
,npm install express
等。它只是打印这个:
Usage: npm <command>
where <command> is one of:
access, adduser, bin, bugs, c, cache, completion, config,
ddp, dedupe, deprecate, dist-tag, docs, doctor, edit,
explore, get, help, help-search, i, init, install,
install-test, it, link, list, ln, login, logout, ls,
outdated, owner, pack, ping, prefix, profile, prune,
publish, rb, rebuild, repo, restart, root, run, run-script,
s, se, search, set, shrinkwrap, star, stars, start, stop, t,
team, test, token, tst, un, uninstall, unpublish, unstar,
up, update, v, version, view, whoami
npm <command> -h quick help on <command>
npm -l display full usage info
npm help <term> search for help on <term>
npm help npm involved overview
Specify configs in the ini-formatted file:
/home/user/.npmrc
or on the command line via: npm <command> --key value
Config info can be viewed via: npm help config
npm@5.6.0 /usr/lib/node_modules/npm
就好像该命令已在该男子中注册但无法正常工作。我对此非常陌生。我不知道它有什么问题。
错误与命令的sintax错误相同。即使我运行npm any-string-here
,打印也是一样的。
我已经尝试清除nodejs并清除所有node_modules和库,以便彻底安装nodejs和npm,但问题仍然存在。怎么可能是错的?
注意:Nodejs工作正常。我可以毫无问题地运行nodejs file.js
。这只是npm谁不认识。