npm i -g playwright
Install a package and then import it in a .js
file. Run
it by node file.js
. It reports that the module is not
found. The reason is that NODE_PATH
is not set up.
Solution: Add the following line to .bashrc
export NODE_PATH=$NODE_PATH:`npm root -g`
npm list -g --depth=0