3

I'm having this error during running the following command on Windows 10.

npm run dev 

I'm running lite-server on windows 10, I have tried to solve it using the following commands

npm install -g npm-windows-upgrade
npm install -g concurrently

although I have tried to remove package.json and node modules, reinstalling nodejs. but it seems it is not working.

CMD Err running npm run dev logfile as in the following

1 verbose cli [
1 verbose cli   'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'run',
1 verbose cli   'dev'
1 verbose cli ]
2 info using npm@6.12.0
3 info using node@v12.13.0
4 verbose run-script [ 'predev', 'dev', 'postdev' ]
5 info lifecycle AmrAhmed@1.0.0~predev: AmrAhmed@1.0.0
6 info lifecycle AmrAhmed@1.0.0~dev: AmrAhmed@1.0.0
7 verbose lifecycle AmrAhmed@1.0.0~dev: unsafe-perm in lifecycle true
8 verbose lifecycle AmrAhmed@1.0.0~dev: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\Amr\Desktop\Seecured-master\Seecured-master\election\node_modules\.bin;C:\Users\Amr\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\local\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Users\Amr\bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files\Microsoft SQL Server\110\Tools\Binn;C:\Program Files\MATLAB\R2014a\runtime\win64;C:\Program Files\MATLAB\R2014a\bin;C:\Program Files\MATLAB\R2014a\polyspace\bin;C:\Program Files\nodejs;C:\Program Files\Git\cmd;C:\SRC\flutter\bin;C:\Users\Amr\AppData\Local\Programs\Python\Python36\Scripts;C:\Program Files\CMake\bin;C:\Program Files\nodejs;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files\Microsoft SQL Server\110\Tools\Binn;C:\Program Files\MATLAB\R2014a\runtime\win64;C:\Program Files\MATLAB\R2014a\bin;C:\Program Files\MATLAB\R2014a\polyspace\bin;C:\Program Files\nodejs;C:\Program Files\Git\cmd;C:\SRC\flutter\bin;C:\Users\Amr\AppData\Local\Programs\Python\Python36\Scripts;C:\Program Files\CMake\bin;C:\Python37\Scripts;C:\Users\Amr\AppData\Local\Programs\Microsoft VS Code\bin;C:\Python37\Scripts;C:\Users\Amr\AppData\Lo;C:\Program Files\nodejs;C:\Program Files\Git\usr\bin\vendor_perl;C:\Program Files\Git\usr\bin\core_perl
9 verbose lifecycle AmrAhmed@1.0.0~dev: CWD: C:\Users\Amr\Desktop\Seecured-master\Seecured-master\election
10 silly lifecycle AmrAhmed@1.0.0~dev: Args: [ '/d /s /c', 'lite-server' ]
11 silly lifecycle AmrAhmed@1.0.0~dev: Returned: code: 1  signal: null
12 info lifecycle AmrAhmed@1.0.0~dev: Failed to exec dev script
13 verbose stack Error: AmrAhmed@1.0.0 dev: `lite-server`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack     at EventEmitter.emit (events.js:210:5)
13 verbose stack     at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:210:5)
13 verbose stack     at maybeClose (internal/child_process.js:1021:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
14 verbose pkgid AmrAhmed@1.0.0
15 verbose cwd C:\Users\Amr\Desktop\Seecured-master\Seecured-master\election
16 verbose Windows_NT 10.0.17763
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "dev"
18 verbose node v12.13.0
19 verbose npm  v6.12.0
20 error code ELIFECYCLE
21 error errno 1
22 error AmrAhmed@1.0.0 dev: `lite-server`
22 error Exit status 1
23 error Failed at the AmrAhmed@1.0.0 dev script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

and the package.json file has the following scripts

{
  "name": "AmrAhmed",
  "version": "1.0.0",
  "description": "",
  "main": "truffle.js",
  "directories": {
    "test": "test"
  },
  "scripts": {
    "dev": "lite-server",
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "lite-server": "^2.3.0"
  }
}
Amr
  • 646
  • 1
  • 6
  • 21

3 Answers3

13

you should run this command line

npm install lite-server@2.3 --save-dev
mybrave
  • 1,662
  • 3
  • 20
  • 37
Thai Nguyen
  • 214
  • 1
  • 5
0

I have reinstalled nodejs 12.16.3 Long term support release and it seems the problem is solved and it worked perfectly.

Running Npm run dev

Amr
  • 646
  • 1
  • 6
  • 21
0

I have written a script inside of my package.json file like this and it worked.

"scripts": {
    "start": "npm run lite",
    "lite" : "lite-server"
  }
Suraj Rao
  • 29,388
  • 11
  • 94
  • 103