After manually install Debian NodeJs, execute bin \ npm newspaper: / usr / bin / env: node: No such file or directory

Add the bin directory under NodeJS in / etc / profile inside, like this:

You can perform normal when performing node and npm. Note NODE_HOME path modification according to the actual situation. NODE_HOME name at random, to ensure consistent export NODE_HOME and $ NODE_HOME name.

After editing execution: source / etc / profile

debian 10 pro-test success.

Because in order to perform npm, must be built on the basis of nodejs, npm executable file, need to use node, npm file in the default node environment already be in place, and can perform node directly from the command line.

 

 If you do not want to declare NodeJS profile environment variables, you can modify npm executable file to this:

 

 npm can perform normal after modification.

export declaration similar to a variable;

$ Export similar reference variables declared;

Mainly in the PATH variable, PATH is all stored execution file path on your system, each execution file path divided by :( colon), the order followed to find the path through each command execution system.

Recently upgraded Debian10, start the installation environment, before loading nodejs are installed automatically by apt, for a moment this attempt to manually install nodejs.

Decompression execution node is no problem, do npm Times: / usr / bin / env: node: No such file or directory or / usr / bin / env: node: no file or directory.

 

Guess you like

Origin www.cnblogs.com/GengMingYan/p/11521923.html