Solution to the incompatibility between node and gulp: 1. Create a new "npm-shrinkwrap.json" file in the same directory as the "package.json" file; 2. Execute the "npm install" command; 3. Execute "gulp build" on the command line.
The operating environment of this tutorial: Windows 7 system, node18.4.0 version, Dell G3 computer.
What should I do if node is not compatible with gulp?
REFERENCEERROR: PRIMORDIALS IS NOT DEFINED, that is, the nodejs and gulp versions are incompatible
Solution to REFERENCEERROR: PRIMORDIALS IS NOT DEFINED, that is, the nodejs and gulp versions are incompatible
When building the front-end project, gulp is used, but an error occurs during gulp build, as follows:
Various answers found on the Internet say it is node.js It is not compatible with the gulp version, so I checked my own version, as follows:
According to the solution of upgrading gulp or rolling back the node.js version, I chose the latter , but failed.
According to the solution of another blogger, it was successful. The method is as follows:
Create a new npm-shrinkwrap.json file in the same directory as the package.json file
It needs to contain
{ “dependencies”: { “graceful-fs”: { “version”: “4.2.3” } } }
Execution: npm install
Note that after executing npm install once, this file will have no effect next time.
5. Finally executed on the command line, successful
gulp build
Note: When gulp -v is used, 'gulp' is displayed Not recognized as an internal or external command, operable program or batch file. Then gulp is executed globally,
npm install gulp -g
wants to execute gulp globally. Just configure the environment variables of node to achieve the purpose.
Right-click on the computer =》Properties =》 =》Advanced system settings =》Environment variables
Recommended learning: "nodejs video tutorial"
The above is the detailed content of What to do if node is not compatible with gulp. For more information, please follow other related articles on the PHP Chinese website!