will install it automatically after the installation is complete.$ sudo apt-get install nodejsAfter the installation is complete, we look at the versions of Nodejs and NPM.$ node -vv8.5.0$ npm -vv5.3.0Configuring the NPM WarehouseBecause the domestic network environment, directly from the NPM official source installs
the process ID is as follows:
PS-C between D-f | grep between d | tr-s ''| cut-D''-F 2
Or
PS aux | grep rjd | grep-V "grep" | awk-F "" '{print $2 }'
B. Stop running the script
Run MongoDB-stop on the command line. 3 nodejs Service Management 3.1 about forever
Forever manages node. js backend operations, restarts, and stops service monitoring.Program. 3.2 forever
Start:
Forever start/home/www/index. js
Stop:
Forever stop/home/www/index. js
Common commands:
Start sta
Usage
@ Mashihua posted the npm image source maintained by him in the cnode newsgroup, which is fast!
The email content is as follows:
I am very happy to inform you. During the free time of the weekend, we set up an image npm resource library, and the server is on Linode in Japan. You can use the following command to install the npm module:
$
;}module.exports = greeting;
This code exports a function that can be published and relied upon.
NPM AddUser
The first time you use this private repository you need to add users
npm adduser --registry http://ubuntu-17:4873
NPM Publish
And then post the code up there.
1. Generate a. Reg file in batches to operate the Registry
You can easily generate the. reg file with the redirection symbol in the batch. Run the. reg file!
Here, I want to know how to operate the registry using the. reg file.
The first line of the. reg file must be Windows Registry Editor Version 5.00. Then the content of the
One, batch generation. REG file Operations Registry
You can easily generate. reg files by using the redirection symbols in batch processing. Then use the command to execute the. reg file!
Here, focus on how the. reg file operates the registry.
First the. reg file must be the first line: Windows Registry Editor Version 5.00. The contents of the
Webpack command:Webpack--watch Monitor changes and automatically package, abbreviated-WWebpack-p--progress--color Compression obfuscation scriptwebpack-d generate a mapping file to tell where those modules are packagedWebpack--disply-error-detailsNPM command:NPM InitNPM Install Webpack-gNPM Install Webpack-save-devNPM Install Url-loader-save-devNPM run Build-dist Generate Dist folderNPM Run clean cleans up packaged files NPM configuration:
Node Package Manager (node Packaged manager,npm)Node Package module (node Packaged module,module)
Example of
option
description
1
Search
Find a module package in the repository
NPM Search Express
2
Install
Use a Package.json file on a repository or local location to install the package
The example in the previous log should run the "NPM install formidable" instruction installation module to support file uploads.
If your browser has a proxy server, or if your office environment has blocked HTTPS, you will need to set up NPM environment variables.
The error message I see is this:
NPM err! Error:failed to fetch from registry:formidable
First l
Nodejs Mirroring Configuration
Nodejs and NPM Warehouse hosted on the S3, in the domestic access is very difficult, here can use Taobao Mirror station npm.taobao.org instead. Here are several different ways to use the Nodejs image of Taobao: NVM using Taobao image
Many people will use NVM to manage the local Nodejs version. NVM supports the download addresses of Nodejs and IOJS via environment variables.
Configure these two environment variables: Nvm
node. js command in--------------------------------node app Prompt and node. js---------------------------------------• After installing node. js, there are two bootable apps: the black node. js command Prompt and the green node. JS• The black node. js command Prompt is the same as the CMD DOS console, and when the Node-v is entered, the node's version number appears, indicating that the current node environment is installed OK. • When you enter the node command and enter the JS encoding environ
NPM Install always complains: Unable to verify of the first certificate (unable to verify the primary certificate), check the discovery
As of February, 2017, NPM no longer supports its self-signed certificates.
February 27, 2017, NPM no longer supports self-signed certificates.
Because NPM install is going with the
The NPM image of Taobao is a complete npmjs.org mirror image. You can use this instead of the official version (read only), the sync frequency is currently 15 minutes to ensure that as far as possible with the official service synchronization.
1. The current registry.npm.taobao.org is a full volume synchronization from the registry.npmjs.org.2. The current npm.taobao.org run version is: cnpmjs.org@0.4.13. The system runs on the node.js@v0.11.12.
Ins
1. Run NPM download dependency component in the virtual device times wrong:
NPM err! Eproto:protocol error, Symlink ...
Solution:
Add parameter--no-bin-links when running NPM
NPM Install--no-bin-links
2. Execute gulp command times wrong:
Enoent:no such file or directory, Scandir '/home/vagrant/code/sample/node_
include the following:
Copy Code code as follows:
Console.log (' Hello world! ');
The node executable is then invoked with the filename of the script as the first parameter parameter:
Copy Code code as follows:
$ node Hello_world.js
Hello world!
Finally, use Ctrl+d or CTRL + C to exit the node command-line interface.
Preparing and using the node Package Manager
So far, you can only use the language features and core functions of node itsel
Every time NPM, go abroad mirror, very slow, can be configuredBy changing the default NPM Mirror Proxy service, the following three ways to solve any of the problems, we recommend the use of a third, the configuration is written to death, the next time you do not have to reconfigure.Through the config command
NPM Config Set
add the environment variable.NODE_PATHThe value is:F:\nodejs\node_modules
To test whether the installation is successful, enternode -v,npm -vTo check whether the version numbers of both are output. if the version numbers are output, the table is output successfully.
Due to XXX, you may often encounter downloading packages when using them. Therefore, it is best to set npm domestic images. The command is a
node. js npm Details One, NPM introductionInstall NPM Please read the predecessor's article, very detailed introduction.The full name of NPM: Node package Manager.(1) Popular understandingIn fact, you can literally understand what this product does, translating it into "node package manager." Yes, that's a management t
Once you've learned about the basics of the registry, we can officially enter the topic we want to discuss: Edit and modify the registry! Generally speaking, there are three ways to add, delete and change the registry:
The first way: direct modification (least secure, but most direct and effective)
is through Registry
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.