child-process-promise
child-process-promise copied to clipboard
`fs` and `child_process` not found
I've successfully installed the package. When I try to run my app with an import of exec
from the package, npm fails to build because it cannot find fs
and child_process
.
The app is an Angular one and I'm trying to import the package in the main.ts
file in the root of the project.
The exact errors:
ERROR in ./node_modules/child-process-promise/lib/index.js
Module not found: Error: Can't resolve 'child_process' in 'my_project\node_modules\child-process-promise\lib'
ERROR in ./node_modules/child-process-promise/lib-es5/index.js
Module not found: Error: Can't resolve 'child_process' in 'my_project\node_modules\child-process-promise\lib-es5'
ERROR in ./node_modules/child-process-promise/node_modules/cross-spawn/index.js
Module not found: Error: Can't resolve 'child_process' in 'my_project\node_modules\child-process-promise\node_modules\cross-spawn'
ERROR in ./node_modules/child-process-promise/node_modules/cross-spawn/lib/parse.js
Module not found: Error: Can't resolve 'fs' in 'my_project\node_modules\child-process-promise\node_modules\cross-spawn\lib'
ERROR in ./node_modules/isexe/index.js
Module not found: Error: Can't resolve 'fs' in 'my_project\node_modules\isexe'
ERROR in ./node_modules/isexe/mode.js
Module not found: Error: Can't resolve 'fs' in 'my_project\node_modules\isexe'
ERROR in ./node_modules/isexe/windows.js
Module not found: Error: Can't resolve 'fs' in 'my_project\node_modules\isexe'
You do not need to install them. They are built into node.
child_process
comes from the node environment. Normally Angular is using webpack
and targeting browser clients and it can not be used. Not sure what's the use case you have.