【发布时间】:2019-08-02 03:18:37
【问题描述】:
所以我使用 CLI 创建了一个新的NestJS 应用程序。我将nodemon 作为依赖项安装在全局范围内。我的package.json 看起来像这样:
"scripts": {
"build": "tsc -p tsconfig.build.json",
"format": "prettier --write \"src/**/*.ts\"",
"start": "ts-node -r tsconfig-paths/register src/main.ts",
"start:dev": "nodemon",
"start:debug": "nodemon --config nodemon-debug.json",
而我的nodemon.json 看起来像这样:
"watch": ["src"],
"ext": "ts",
"ignore": ["src/**/*.spec.ts"],
"exec": "ts-node -r tsconfig-paths/register src/main.ts"
非常基本的设置。但是,如果我尝试使用以下命令启动开发服务器:npm start:dev,我会收到以下错误消息:
Usage: npm < command >
where < command > is one of:
access, adduser, audit, bin, bugs, c, cache, ci, cit,
clean-install, clean-install-test, completion, config,
create, ddp, dedupe, deprecate, dist-tag, docs, doctor,
edit, explore, get, help, help-search, hook, i, init,
install, install-ci-test, install-test, it, link, list, ln,
login, logout, ls, org, 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
Specify configs in the ini-formatted file: /Users/XXXXX/.npmrc
or on the command line via: npm <command> --key value
Config info can be viewed via: npm help config
npm@6.6.0 /usr/local/lib/node_modules/npm
Did you mean this?
start
我的npmrc 包含我工作中的 github 存储库的一些凭据!
【问题讨论】:
-
因为在搜索了很多之后我找不到任何与此相关的内容,所以我在一个有点相关的帖子stackoverflow.com/a/59803280/588003 上创建了这个评论。