I'm working on a Gatsby site. I have test
in my package.json
set to "test": "jest --watch --no-cache",
. Mostly, when I save, watch works with no issue. However, occasionally, perhaps with a syntax error, my watch errors, fails and exits. I'd like to fix this but don't really know what direction to head based on this error.
My Jest console output is the following:
Test Suites: 0 of 8 total
Tests: 0 total
Snapshots: 0 total
Time: 0 sinternal / fs / watchers.js: 173
throw error;
^
Error: ENOENT: no such file or directory, watch '/home/[USER]/backup/myGatsbySite/.cache/redux.bak'
at FSWatcher.start(internal / fs / watchers.js: 165: 26)
at Object.watch(fs.js: 1340: 11)
at NodeWatcher.watchdir(/home/[USER] / backup / myGatsbySite / node_modules / sane / src / node_watcher.js: 159: 22)
at NodeWatcher.<anonymous>(/home/[USER] / backup / myGatsbySite / node_modules / sane / src / node_watcher.js: 295: 18)
at FSReqCallback.oncomplete(fs.js: 170: 5) {
errno: -2,
syscall: 'watch',
code: 'ENOENT',
path: '/home/[USER]/backup/myGatsbySite/.cache/redux.bak',
filename: '/home/[USER]/backup/myGatsbySite/.cache/redux.bak'
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! gatsby-starter-default@0.2.0 test: `jest --watch --no-cache`
npm ERR! Exit status 1
There's also a link to an npm
log which I've pasted below.
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli '/home/[USER]/.nvm/versions/node/v12.11.1/bin/node',
1 verbose cli '/home/[USER]/.nvm/versions/node/v12.11.1/bin/npm',
1 verbose cli 'run',
1 verbose cli 'test'
1 verbose cli ]
2 info using npm@6.11.3
3 info using node@v12.11.1
4 verbose run-script [ 'pretest', 'test', 'posttest' ]
5 info lifecycle gatsby-starter-default@0.2.0~pretest: gatsby-starter-default@0.2.0
6 info lifecycle gatsby-starter-default@0.2.0~test: gatsby-starter-default@0.2.0
7 verbose lifecycle gatsby-starter-default@0.2.0~test: unsafe-perm in lifecycle true
8 verbose lifecycle gatsby-starter-default@0.2.0~test: PATH: /home/[USER]/.nvm/versions/node/v12.11.1/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/[USER]/backup/myGatsbySite/node_modules/.bin:/home/[USER]/.shopify-app-cli/bin/user:/home/[USER]/.nvm/versions/node/v12.11.1/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
9 verbose lifecycle gatsby-starter-default@0.2.0~test: CWD: /home/[USER]/backup/myGatsbySite
10 silly lifecycle gatsby-starter-default@0.2.0~test: Args: [ '-c', 'jest --watch --no-cache' ]
11 silly lifecycle gatsby-starter-default@0.2.0~test: Returned: code: 1 signal: null
12 info lifecycle gatsby-starter-default@0.2.0~test: Failed to exec test script
13 verbose stack Error: gatsby-starter-default@0.2.0 test: `jest --watch --no-cache`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (/home/[USER]/.nvm/versions/node/v12.11.1/lib/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> (/home/[USER]/.nvm/versions/node/v12.11.1/lib/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 gatsby-starter-default@0.2.0
15 verbose cwd /home/[USER]/backup/myGatsbySite
16 verbose Linux 5.4.0-7642-generic
17 verbose argv "/home/[USER]/.nvm/versions/node/v12.11.1/bin/node" "/home/[USER]/.nvm/versions/node/v12.11.1/bin/npm" "run" "test"
18 verbose node v12.11.1
19 verbose npm v6.11.3
20 error code ELIFECYCLE
21 error errno 1
22 error gatsby-starter-default@0.2.0 test: `jest --watch --no-cache`
22 error Exit status 1
23 error Failed at the gatsby-starter-default@0.2.0 test script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
I don't really know where to start. Answers that solve the problem are welcome, but those that explain what part of these two errors you read so I can trouble shoot this myself going forward would be especially appreciated.
Aucun commentaire:
Enregistrer un commentaire