1
resposta

"npm run start" apresentando erro

alurabank@1.0.0 start C:\Users\Herberton\Documents\typescript-curso-1-arquivos-iniciais concurrently "npm run watch" "npm run server"

C:\Users\Herberton\Documents\typescript-curso-1-arquivos-iniciais\node_modules\concurrently\node_modules\supports-color\browser.js:5 const matches = /(Chrome|Chromium)/(?\d+)./.exec(navigator.userAgent); ^

ReferenceError: navigator is not defined at getChromeVersion (C:\Users\Herberton\Documents\typescript-curso-1-arquivos-iniciais\node_modules\concurrently\node_modules\supports-color\browser.js:5:68) at Object. (C:\Users\Herberton\Documents\typescript-curso-1-arquivos-iniciais\node_modules\concurrently\node_modules\supports-color\browser.js:14:22) at Module.compile (internal/modules/cjs/loader.js:1139:30) at Object.Module.extensions..js (internal/modules/cjs/loader.js:1159:10) at Module.load (internal/modules/cjs/loader.js:988:32) at Function.Module.load (internal/modules/cjs/loader.js:896:14) at Module.require (internal/modules/cjs/loader.js:1028:19) at require (internal/modules/cjs/helpers.js:72:18) at Object. (C:\Users\Herberton\Documents\typescript-curso-1-arquivos-iniciais\nodemodules\concurrently\src\get-spawn-opts.js:1:23) at Module._compile (internal/modules/cjs/loader.js:1139:30) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! alurabank@1.0.0 start: concurrently "npm run watch" "npm run server" npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the alurabank@1.0.0 start script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\Herberton\AppData\Roaming\npm-cache_logs\2022-05-09T21_49_23_815Z-debug.logPS C:\Users\Herberton\Documents\typescript-curso-1-arquivos-iniciais>

1 resposta

Opa! Boa tarde Herberton, tudo bem?

Em seu arquivo packages.json está exatamente dessa forma?

{ "name": "alurabank", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "test": "echo "Error: no test specified" && exit 1", "server": "lite-server --baseDir=dist", "start": "concurrently "npm run watch" "npm run server"", "compile":"tsc", "watch":"tsc -w" }, "author": "", "license": "ISC", "devDependencies": { "concurrently": "^6.0.0", "lite-server": "^2.6.1", "typescript": "^4.2.2" } }

Caso, mesmo estando dessa forma e o problema ainda persistir, recomendo que atualize seu nodejs.