nodejs I will not introduce, IT is very hot technology recently, the function is very powerful. I also did some research. Error when installing a nodejs software project:
npm ERR! Error: CERT_UNTRUSTED
after careful screening and Google, turns out to be the SSL problem:
solution:
npm config set strict-ssl false
or p>
npm config set registry=”http://registry.npmjs.org/”
to continue error error-code-elifecycle, execute the following command:
NPM cache clear –force
NPM install -g NPM (upgrade)
solution: command prompt (run as an administrator) [run as a super administrator for Windows, Linux requires sudo]
note: please try to run this command again as root/Administrator.
sudo
sudo NPM install –save-dev grunt
but this may not work, you need to do this:
sudo NPM install –unsafe-perm=true –save-dev grunt
perhaps you will still encounter an error, try
sudo npm install –unsafe-perm=true –allow-root –save-dev grunt
background: after installing nodejs on Linux, I have been using the NPM install command to install project dependencies that have been denied permission undefined. I am root.
solution, need this command.
npm install –unsafe-perm=true –allow-root
Replace an NPM installation source as follows:
1, through the config command NPM config set registry https://registry.npm.taobao.org NPM info the underscore (if there could be strings configured properly this command response) span> p>
2, command line specifies the NPM – registry https://registry.npm.taobao.org info the underscore and then install it span> p>
and then rerun NPM install -g **** OK ~~~
p>
a good habit in the project life cycle when installing a new dependent module NPM install XXX – save
NPM added – save dependent module version information will be written to the package.
in the json every time such in server deployment directly cp package files NPM install can be in accordance with the package. The information in the json (reduction) deployment as dependent on good operation environment p>
of course, the most important thing is that node version compatibility is the first
according to my understanding, this kind of node, is not only to indicate the dependent package version, but also indicate the other version dependencies, such as running environment version number and build tools version, operating system, database version, because the node changing fast (also different update quickly, ECS grammar) strong> p>
node version is too low?
install n module: sudo NPM install -g n (node has a module called n, which is used to manage versions of node.js)
upgrade node.js to the latest stable version in the terminal input: n stable
you can check the node version installed successfully: node-v
shares several common NPM commands
npm-v # displays the version and checks to see if NPM is installed correctly.
NPM install express # express module
NPM install -g express # global install express module
NPM list # lists installed modules
NPM show express # display module details
NPM update # updates all modules of the project in the current directory
NPM update express # updates the specified module of the project in the current directory
NPM update-g express # upgrade globally installed express module
NPM uninstall express # remove the specified module
p>
Read More:
- “NPM err! Error: eperm: operation not permitted” problem solving
- Failed to load resource: net::ERR_ INSECURE_ Response problem solving record
- NPM run serve reported an error “NPM err! Missing script: start”
- Chrome browser network error: err_ CERT_ AUTHORITY_ INVALID
- NPM err! Code enotfound (2020-07-03)
- chrome: Failed to load resource: net::ERR_CERT_AUTHORITY_INVALID
- NPM install error | gyp err! Configure error
- The solution of NPM err! Code elifecycle
- NPM install error: gyp err! Configure error
- Solve NPM err! code 128
- Solution of NPM err! Code elifecycle
- npm ERR Error: EPERM:operation not permitted, rename
- NPM ERR! Error: EACCES: permission denied, access ‘/usr/local/lib/node_modules’
- Error “NPM err” when starting Vue project! code ELIFECYCLE”
- npm ERR! registry error parsing json error report solution
- NPM run dev error (ERR: Code lifecycle)
- [DRC nstd-1] problem solving of vivado error problem
- “Failed to load session” Ubuntu “problem solving summary
- firefox sec_error_untrusted_issuer
- Solve CONDA’s “solving environment: failed” problem