Hicksfeld
Hicksfeld

Reputation: 29

How to run npm.cmd?

I stumbled over this discussion: https://github.com/nodejs/node/issues/3675

when googling this error:

{ 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' ] }

but I dont know how to access this npm.cmd. I was on their site https://www.npmjs.com/package/node-cmd and I installed it with npm install node-cmd but Im pretty clueless how to run it, Im getting errors like this when typing

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.

Basically, I want to run this node-cmd inside my project so I can (hopefully) execute:

npx webpack-cli init

successfully

Upvotes: 2

Views: 8021

Answers (1)

winux
winux

Reputation: 482

if you're running under win32 try for example:

When installing packages

npm.cmd install

or Run npm scripts syncrhonously

npm.cmd run sync -- --init

Upvotes: 2

Related Questions