node运行js文件报错

叁歲伎倆 2022-12-26 08:21 327阅读 0赞

node运行js文件,报以下提示:

  1. F:\test>npm app.js
  2. Usage: npm <command>
  3. where <command> is one of:
  4. access, adduser, audit, bin, bugs, c, cache, ci, cit,
  5. clean-install, clean-install-test, completion, config,
  6. create, ddp, dedupe, deprecate, dist-tag, docs, doctor,
  7. edit, explore, fund, get, help, help-search, hook, i, init,
  8. install, install-ci-test, install-test, it, link, list, ln,
  9. login, logout, ls, org, outdated, owner, pack, ping, prefix,
  10. profile, prune, publish, rb, rebuild, repo, restart, root,
  11. run, run-script, s, se, search, set, shrinkwrap, star,
  12. stars, start, stop, t, team, test, token, tst, un,
  13. uninstall, unpublish, unstar, up, update, v, version, view,
  14. whoami
  15. npm <command> -h quick help on <command>
  16. npm -l display full usage info
  17. npm help <term> search for help on <term>
  18. npm help npm involved overview
  19. Specify configs in the ini-formatted file:
  20. C:\Users\mbshq\.npmrc
  21. or on the command line via: npm <command> --key value
  22. Config info can be viewed via: npm help config
  23. npm@6.14.6 D:\Program Files\nodejs\node_modules\npm

解决方法:

  1. npm命令换为node

发表评论

表情:
评论列表 (有 0 条评论,327人围观)

还没有评论,来说两句吧...

相关阅读

    相关 node执行js文件的问题

    遇到这种问题,就是命令当前的执行目录找不到你要执行的js文件,即使你用git bash here 也可能会有这个错误,这个时候最简单的处理方式就是 (1)打开命令框   (