I have a project with a package.json file, generated by YARN.
How can I load a js REPL and load a library that's specified in the package.json file?
With npm
or with yarn
you can download and install locally all the dependencies specified in a package.json
file.
First thing is to run the install command:
my-project $ npm install
or
my-project $ npm install
This command is going to install locally all the dependencies in your package.json file.
Now you should have a new folder node_modules
that contains all the code.
On a js file:
// index.js
const myLib = require('myLib')
Now you can work with the library.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.