Can't resolve 'child_process'
Hi, I'm windows user and i have Angular project, i want to use "gm" project, I installed gm:
npm install gm
then when i start my server i got the error:
ERROR in ./~/cross-spawn/index.js Module not found: Error: Can't resolve 'child_process' in 'D:\my_stuff\tastAngularAPP\tastAngularAPP\node_modules\cross-spawn' @ ./~/cross-spawn/index.js 3:9-33 @ ./~/gm/lib/command.js @ ./~/gm/index.js @ ./src/app/app.component.ts @ ./src/app/app.module.ts @ ./src/main.ts @ multi webpack-dev-server/client?http://localhost:4200/ ./src/main.ts
ERROR in ./~/spawn-sync/index.js Module not found: Error: Can't resolve 'child_process' in 'D:\my_stuff\tastAngularAPP\tastAngularAPP\node_modules\spawn-sync' @ ./~/spawn-sync/index.js 3:17-41 @ ./~/cross-spawn/index.js @ ./~/gm/lib/command.js @ ./~/gm/index.js @ ./src/app/app.component.ts @ ./src/app/app.module.ts @ ./src/main.ts @ multi webpack-dev-server/client?http://localhost:4200/ ./src/main.ts
ERROR in ./~/spawn-sync/lib/spawn-sync.js Module not found: Error: Can't resolve 'child_process' in 'D:\my_stuff\tastAngularAPP\tastAngularAPP\node_modules\spawn-sync\lib' @ ./~/spawn-sync/lib/spawn-sync.js 6:9-33 @ ./~/spawn-sync/index.js @ ./~/cross-spawn/index.js @ ./~/gm/lib/command.js @ ./~/gm/index.js @ ./src/app/app.component.ts @ ./src/app/app.module.ts @ ./src/main.ts @ multi webpack-dev-server/client?http://localhost:4200/ ./src/main.ts
ERROR in ./~/thread-sleep/index.js Module not found: Error: Can't resolve 'child_process' in 'D:\my_stuff\tastAngularAPP\tastAngularAPP\node_modules\thread-sleep' @ ./~/thread-sleep/index.js 3:19-43 @ ./~/try-thread-sleep/index.js @ ./~/spawn-sync/lib/spawn-sync.js @ ./~/spawn-sync/index.js @ ./~/cross-spawn/index.js @ ./~/gm/lib/command.js @ ./~/gm/index.js @ ./src/app/app.component.ts @ ./src/app/app.module.ts @ ./src/main.ts @ multi webpack-dev-server/client?http://localhost:4200/ ./src/main.ts
any Idea?
Thanks, Yosef
First, gm is a back-end project, which should not be used by a front-end project.
Second, webpack's resolving a module path only support modules in the resolve.modulesDirectories, u can check the document here.
@xingxingted It's all javascript.