Failed to compile.
Fsevents /node_modules/[email protected]@fsevents/node_modules/ detector-libc /lib/ detector-libc.js
Module not found: Error: Can’t resolve ‘child_process’ in ‘D:\Today\WebFront\node_modules\[email protected]@fsevents\node_modules\detect-libc\lib’
NPM install –save child_process FS prompted by various attempts, also tried to delete node_modules folder to re-install NPM, and even sent the code undo back to re-paste the files with changes, but failed!
Baidu saw that someone had encountered similar problems, and added the following nodes in Webpack.base.config.js:
Fsevents /node_modules/[email protected]@fsevents/node_modules/ detector-libc /lib/ detector-libc.js
Module not found: Error: Can’t resolve ‘child_process’ in ‘D:\Today\WebFront\node_modules\[email protected]@fsevents\node_modules\detect-libc\lib’
NPM install –save child_process FS prompted by various attempts, also tried to delete node_modules folder to re-install NPM, and even sent the code undo back to re-paste the files with changes, but failed!
Baidu saw that someone had encountered similar problems, and added the following nodes in Webpack.base.config.js:
node: {
// prevent webpack from injecting useless setImmediate polyfill because Vue
// source contains it (although only uses it if it's native).
//setImmediate: false,
// prevent webpack from injecting mocks to Node native modules
// that does not make sense for the client
//dgram: 'empty',
fs: 'empty',
//net: 'empty',
//tls: 'empty',
child_process: 'empty'
}
This action will result in a compile without error, but with various warnings, NPM Run Dev will not load the VUE component; It seems that there is no way around this question.
Think carefully about what the code changed before the error: found the following weird import
When I add debugger, the VS tool automatically introduces this for me, kill it, and re-run NPM run Dev
See the long lost green prompt:
Alas, I spent half a day trying to solve the problem, and I learned a lot in the process of finding the problem. There were still many pits in the application of VUE, which led to all kinds of strange mistakes. Record here!
Read More:
- Mongodb failed to start: child process failed, exited with error number 100
- Git bash here running error: failed to fork child process
- Solve the error in Ubuntu 18.04: called “net usershare info” but it failed: failed to execute child process “net”
- Mongodb start error: child process failed, exited with error number 1
- Error: child process failed, exited with error number 1
- Git bash Error: Could not fork child process: There are no available terminals (-1)
- Error: Could not fork child process: There are no available terminals (-1).
- Error:could not fork child process: There are no available terminals (-1).
- Vtk8.0 compilation process record under vs2017 and qt5.12.1
- Opencv opencvsharpexternal compilation and recording process
- npm start:Module not found: Error: Can’t resolve ‘xlsx’ in ‘/Users/huzhiqi/Downloads/web/…
- “Error in configuration process project files may be invalid” appears during cmake compilation
- [error record] kotlin code compilation error when Android studio compiles (process @ nonnull parameter when upgrading support library)
- A child container failed during start
- Command failed: NPM install — loglevel error — registry= https://registry.npm.taobao.org
- Error configuration process and project file may be invalid appear in cmake compilation
- A child container failed during start Tomcat error prompt
- Error: (serious: a child container failed during start) (server component failed to start so Tomcat is unable)
- Caused by: org.apache.catalina.LifecycleException: A child container failed during start
- Error: unable to resolve dependency for… Could not resolve project