如何运行npm.cmd?

如何运行npm.cmd?,npm,Npm,我无意中听到了这个讨论: 用谷歌搜索此错误时: { Error: spawn npm ENOENT at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19) at onErrorNT (internal/child_process.js:415:16) at process._tickCallback (internal/process/next_tick.js:63:19)

我无意中听到了这个讨论:

用谷歌搜索此错误时:

{ Error: spawn npm ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
    at onErrorNT (internal/child_process.js:415:16)
    at process._tickCallback (internal/process/next_tick.js:63:19)
  errno: 'ENOENT',
  code: 'ENOENT',
  syscall: 'spawn npm',
  path: 'npm',
  spawnargs: [ 'root', '-g' ] }
但是我不知道如何访问这个npm.cmd。我在他们的网站上 我用npm安装节点cmd安装了它 但是我不知道如何运行它,我打字时会遇到这样的错误

npm run node-cmd

npm ERR! path D:\nodeJS\node-v10.16.0-win-x64\package.json
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open 'D:\nodeJS\node-v10.16.0-win-x64\package.json'
npm ERR! enoent This is related to npm not being able to find a file.
基本上,我希望在我的项目中运行此节点cmd,以便(希望)执行:


成功

如果您在win32下运行,请尝试以下示例:

安装软件包时

npm.cmd install
或者同步运行npm脚本

npm.cmd run sync -- --init
npm.cmd run sync -- --init