parece que essa frase da computação não ser uma ciência exata será algo bem recorrente! rs
mesmo com sucesso da execução, o log de erro não foi sobrescrito. Anexei o log e o package.json abaixo.
Rodei os comandos "npm install" e "npm run watch". Não funcionou de primeira. Reiniciei e executei os dois na sequência novamente e foi ok. Não sei mais o que dizer...
Pelo meu entendimento, o npm install olha para o package.json e instala o que precisa, tem o watch lá dentro. Na primeira execução, o "npm install" retornava a mensagem abaixo:
$ npm install
npm WARN client@1.0.0 No repository field.
audited 5789 packages in 3.685s
found 0 vulnerabilities
o mesmo comando depois que reiniciei teve o comportamento abaixo;
$ npm install
npm WARN deprecated babel-preset-es2017@6.24.1: Thanks for using Babel: we recommend using babel-preset-env now: please read babeljs.io/env to update!
> fsevents@1.2.9 install /Users/paulopompeu/javascript/projeto-webpack/client/node_modules/fsevents
> node install
node-pre-gyp WARN Using needle for node-pre-gyp https download
[fsevents] Success: "/Users/paulopompeu/javascript/projeto-webpack/client/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64/fse.node" is installed via remote
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN client@1.0.0 No repository field.
added 318 packages from 148 contributors and audited 1847 packages in 12.551s
found 1 low severity vulnerability
run `npm audit fix` to fix them, or `npm audit` for details
Log
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'run', 'watch' ]
2 info using npm@6.9.0
3 info using node@v10.15.3
4 verbose stack Error: missing script: watch
4 verbose stack at run (/usr/local/lib/node_modules/npm/lib/run-script.js:155:19)
4 verbose stack at /usr/local/lib/node_modules/npm/lib/run-script.js:63:5
4 verbose stack at /usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:115:5
4 verbose stack at /usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:418:5
4 verbose stack at checkBinReferences_ (/usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:373:45)
4 verbose stack at final (/usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:416:3)
4 verbose stack at then (/usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:160:5)
4 verbose stack at /usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:280:12
4 verbose stack at /usr/local/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:90:16
4 verbose stack at FSReqWrap.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:53:3)
5 verbose cwd /Users/paulopompeu/.Trash/client
6 verbose Darwin 18.5.0
7 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "watch"
8 verbose node v10.15.3
9 verbose npm v6.9.0
10 error missing script: watch
11 verbose exit [ 1, true ]
package.json
{
"name": "client",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "babel app-src -d app --source-maps",
"watch": "babel app-src -d app --source-maps --watch"
},
"author": "",
"license": "ISC",
"dependencies": {
"reflect-metadata": "^0.1.10",
"systemjs": "^0.20.12"
},
"devDependencies": {
"babel-cli": "^6.24.1",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-plugin-transform-es2015-modules-systemjs": "^6.24.1",
"babel-preset-es2017": "^6.24.1"
}
}