它说npm start
并且npm run start
是相同的,那么在我的情况下npm run watch
工作正常但npm watch
不工作,
以下是我运行时的错误npm watch
:
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:
C:\Users\erdiv\.npmrc
or on the command line via: npm <command> --key value
Config info can be viewed via: npm help config
npm@6.13.4 C:\Program Files\nodejs\node_modules\npm
我的 package.json 是:
{
"name": "web",
"version": "1.0.0",
"description": "",
"main": "main.js",
"scripts": {
"start": "nodemon server.js",
"watch": "npx watchify ./public/main.js -o ./public/bundle.js"
},
"author": "",
"license": "ISC",
"dependencies": {
"budo": "^11.6.3",
"express": "^4.17.1",
"nodemon": "^2.0.3",
"socket.io": "^2.3.0",
"watchify": "^3.11.1"
}
}
请帮忙澄清一下,为什么我不能在这种情况下使用命令“npm watch”。