1. Summary
The npm audit fix command fails After applying the fix, the project becomes non-functional and throws module resolution errors related to @amzn/kepler-ui-components.
App Name: Frndly Tv
2. Steps to Reproduce
npm cache clear --force
npm ci ( to install packages**)**
After this, the project was running successfully.
When I ran:
npm audit
it displayed a list of vulnerabilities.
Then I executed:
npm audit fix
After running this command, the project stopped working and showing error related to kepler -ui-component.Please find the below logs.
3. Observed Behavior
After running the npm audit fix or npm audit fix --force command, the project fails to start. The build shows errors while resolving modules from the Kepler UI component packages. Regular installation (npm ci) works fine, but applying the audit fix breaks the project.
4. Expected Behavior
The npm audit fix command should complete successfully without breaking Kepler libraries. The application should continue to run normally after the audit fix is applied.
5. Logs
error: Error: While trying to resolve module @amzn/keplerscript-native-ui-components from file /home/mohammadirbaaz/Documents/frndlyTV_git/ReactNative-App/node_modules/@amzn/kepler-ui-components/dist/src/components/Carousel/index.js, the package /home/mohammadirbaaz/Documents/frndlyTV_git/ReactNative-App/node_modules/@amzn/keplerscript-native-ui-components/package.json was successfully found. However, this package itself specifies a main module field that could not be resolved (/home/mohammadirbaaz/Documents/frndlyTV_git/ReactNative-App/node_modules/@amzn/keplerscript-native-ui-components/dist/index.js. Indeed, none of these files exist:
- /home/mohammadirbaaz/Documents/frndlyTV_git/ReactNative-App/node_modules/@amzn/keplerscript-native-ui-components/dist/index.js(.native|.kepler.js|.native.js|.js|.kepler.jsx|.native.jsx|.jsx|.kepler.json|.native.json|.json|.kepler.ts|.native.ts|.ts|.kepler.tsx|.native.tsx|.tsx)
- /home/mohammadirbaaz/Documents/frndlyTV_git/ReactNative-App/node_modules/@amzn/keplerscript-native-ui-components/dist/index.js/index(.native|.kepler.js|.native.js|.js|.kepler.jsx|.native.jsx|.jsx|.kepler.json|.native.json|.json|.kepler.ts|.native.ts|.ts|.kepler.tsx|.native.tsx|.tsx)
at DependencyGraph.resolveDependency (/home/mohammadirbaaz/Documents/frndlyTV_git/ReactNative-App/node_modules/metro/src/node-haste/DependencyGraph.js:289:17)
at Object.resolve (/home/mohammadirbaaz/Documents/frndlyTV_git/ReactNative-App/node_modules/metro/src/lib/transformHelpers.js:169:21)
at Graph._resolveDependencies (/home/mohammadirbaaz/Documents/frndlyTV_git/ReactNative-App/node_modules/metro/src/DeltaBundler/Graph.js:472:35)
at Graph._processModule (/home/mohammadirbaaz/Documents/frndlyTV_git/ReactNative-App/node_modules/metro/src/DeltaBundler/Graph.js:260:38)
at async Graph._traverseDependenciesForSingleFile (/home/mohammadirbaaz/Documents/frndlyTV_git/ReactNative-App/node_modules/metro/src/DeltaBundler/Graph.js:248:5)
at async Graph.traverseDependencies (/home/mohammadirbaaz/Documents/frndlyTV_git/ReactNative-App/node_modules/metro/src/DeltaBundler/Graph.js:157:9)
at async DeltaCalculator._getChangedDependencies (/home/mohammadirbaaz/Documents/frndlyTV_git/ReactNative-App/node_modules/metro/src/DeltaBundler/DeltaCalculator.js:281:42)
at async DeltaCalculator.getDelta (/home/mohammadirbaaz/Documents/frndlyTV_git/ReactNative-App/node_modules/metro/src/DeltaBundler/DeltaCalculator.js:112:16)
at async DeltaBundler.getDelta (/home/mohammadirbaaz/Documents/frndlyTV_git/ReactNative-App/node_modules/metro/src/DeltaBundler.js:67:12)
at async IncrementalBundler.updateGraph (/home/mohammadirbaaz/Documents/frndlyTV_git/ReactNative-App/node_modules/metro/src/IncrementalBundler.js:224:19)
Below provided are logs of npm audit fix –force
- Environment
Please fill out the fields related to your bug below:
- SDK Version: 0.20.3351