I encountered error during building Jenkins
Jenkins Log
Task :api:processResources Task :api:classes Task :web:node
I had the same error when running npm install in my repo. I don't use Jenkins, but I found a generic approach to debugging (and ultimately resolving) this issue in NPM.
C:\Users\USERNAME\AppData\Roaming\npm-cache\_logs by default)18 verbose stack TypeError: Cannot read property 'match' of undefined
18 verbose stack at tarballToVersion (C:\Users\USERNAME\AppData\Roaming\nvm\v14.5.0\node_modules\npm\lib\install\inflate-shrinkwrap.js:87:20)
18 verbose stack at inflatableChild (C:\Users\USERNAME\AppData\Roaming\nvm\v14.5.0\node_modules\npm\lib\install\inflate-shrinkwrap.js:113:22)
inflate-shrinkwrap.js file, and go to the line listed in stack-trace line #3 above.tarballToVersion)if (sw.version == null) {
console.error(`
NPM is trying to retrieve package "${name}" with version "undefined"!
Package location: ${(onDiskChild || {}).location}
Package parse error:`, (onDiskChild || {}).error);
}
npm install (or whatever command yields the error). You should see an output like this: NPM is trying to retrieve package with version "undefined"!
Package location: /firebase-feedback/webpack-dev-middleware
Package parse error: [Error: ENOENT: no such file or directory, open 'C:\Root\Apps\@V\@Modules\firebase-feedback\Main\node_modules\webpack-dev-middleware\package.json'] {
errno: -4058,
code: 'ENOENT',
syscall: 'open',
path: 'C:\\Root\\Apps\\@V\\@Modules\\firebase-feedback\\Main\\node_modules\\webpack-dev-middleware\\package.json'
}
C:/Root/Apps/@V/@Modules/firebase-feedback/Main/node_modules folder, then running npm install in the Main folder)Note that in my case, the underlying issue (of the missing package.json file) appears to have been caused by me accidentally running npm install from the parent project (which uses my firebase-feedback library), while I had that library "npm linked".
I normally use npm-safe-install to avoid these sorts of issues (when using npm link), but I must have forgotten sometime recently -- leading to NPM mangling the npm-linked libraries' node_modules folders.
Similar issues relating to npm link have happened before, but I hoped NPM would have patched these sorts of issues by now. Apparently not; though version 7 of NPM has been stated as going to have a rewrite in that area, so hopefully that will solve it long term.