npm dev:start does not run



我的package.json中有以下脚本

{
"name": "demo-api",
"version": "0.0.1",
"description": "",
"author": "",
"license": "MIT",
"scripts": {
"prebuild": "rimraf dist",
"build": "nest build",
"format": "prettier --write "src/**/*.ts" "test/**/*.ts"",
"start": "NODE_ENV=development nest start",
"start:dev": "nest start --watch",
"start:debug": "nest start --debug --watch",
"start:prod": "node dist/main",
"lint": "eslint "{src,apps,libs,test}/**/*.ts" --fix",
"test": "jest",
"test:watch": "jest --watch",
"test:cov": "jest --coverage",
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
"test:e2e": "jest --config ./test/jest-e2e.json"
},
"dependencies": {
"@nestjs/common": "^6.10.14",
"@nestjs/core": "^6.10.14",
"@nestjs/graphql": "^6.6.1",
"@nestjs/jwt": "^6.1.2",
"@nestjs/mongoose": "^6.3.1",
"@nestjs/passport": "^6.2.0",
"@nestjs/platform-express": "^6.10.14",
"@types/graphql": "^14.5.0",
"apollo-server-express": "^2.10.1",
"class-transformer": "^0.2.3",
"dotenv": "^8.2.0",
"graphql": "^14.6.0",
"graphql-tools": "^4.0.7",
"mongoose": "^5.9.2",
"passport": "^0.4.1",
"passport-jwt": "^4.0.0",
"passport-local": "^1.0.0",
"reflect-metadata": "^0.1.13",
"rimraf": "^3.0.0",
"rxjs": "^6.5.4",
"type-graphql": "^0.17.6"
},
"devDependencies": {
"@nestjs/cli": "^6.13.2",
"@nestjs/schematics": "^6.8.1",
"@nestjs/testing": "^6.10.14",
"@types/express": "^4.17.2",
"@types/jest": "25.1.2",
"@types/mongoose": "^5.7.1",
"@types/node": "^13.1.6",
"@types/passport-jwt": "^3.0.3",
"@types/passport-local": "^1.0.33",
"@types/supertest": "^2.0.8",
"@typescript-eslint/eslint-plugin": "^2.12.0",
"@typescript-eslint/parser": "^2.12.0",
"eslint": "^6.7.2",
"eslint-config-prettier": "^6.7.0",
"eslint-plugin-import": "^2.19.1",
"jest": "^24.9.0",
"prettier": "^1.18.2",
"supertest": "^4.0.2",
"ts-jest": "25.2.0",
"ts-loader": "^6.2.1",
"ts-node": "^8.6.0",
"tsconfig-paths": "^3.9.0",
"typescript": "^3.8.2",
"typescript-tools": "^0.3.1"
},
"jest": {
"moduleFileExtensions": [
"js",
"json",
"ts"
],
"rootDir": "src",
"testRegex": ".spec.ts$",
"transform": {
"^.+\.(t|j)s$": "ts-jest"
},
"coverageDirectory": "../coverage",
"testEnvironment": "node"
}
}

当我尝试运行npm start:dev时,会出现以下错误:

git:(develop) 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, fund, 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
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:
/Users/harshamv/.npmrc
or on the command line via: npm <command> --key value
Config info can be viewed via: npm help config
npm@6.13.7 /usr/local/lib/node_modules/npm
Did you mean this?
start

在中创建自定义脚本时,请使用以下命令

npm运行custom-script

例如:npm run start:dev

希望它能帮助

您应该遵循一些步骤。当我陷入这个问题时。

如果您使用node-js和React:步骤1:您应该在package.json脚本中编写一个脚本----->quot;dev":" node --watch node js file (app.mjs)"步骤2:现在应该转到react文件目录,然后----->运行命令:npm run start dev当您编辑项目中的某些内容时,它将自动运行您的react文件

最新更新