因此,我使用CLI创建了一个新的Member
应用程序。我安装了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
包含我工作中的github存储库的凭据!
答案 0 :(得分:4)
要运行npm脚本,必须调用npm run
。所以叫npm run start:dev
。