npm 不会在 NestJS 应用程序上 start:dev
npm won't start:dev on NestJS application
所以我使用 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 回购的一些凭据!
要 运行 一个 npm 脚本,您必须调用 npm run
。所以调用 npm run start:dev
.
所以我使用 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 回购的一些凭据!
要 运行 一个 npm 脚本,您必须调用 npm run
。所以调用 npm run start:dev
.