By default of NPM is installing the modules under "node_modules". Is there a way to change it to be for example "my_modules?
相关问题
- npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fs
- google-drive can't get push notifications
- Failed at the electron@1.8.2 postinstall script
- How to reimport module with ES6 import
- Webpack getting started, import error
相关文章
- node连接远程oracle报错
- How can make folder with Firebase Cloud Functions
- @angular-cli install fails with deprecated request
- node.js modify file data stream?
- How to resolve hostname to an ip address in node j
- Transactionally writing files in Node.js
- Log to node console or debug during webpack build
- Get file created date in node
The standard for all node modules is to use the
node_modules
directory.Do not try to go against this uniform standard.
What are you trying to accomplish by customizing the directory?
Note:
The following command will install a module to
my_project/node_modules/some_module
If you'd like to install modules and have them globally available on your system, you can use the
--global
(-g
) flagPackages installed with the
-g
flag are installed to~/.npm
EDIT
Per your comment, you can attempt to install any directory that contains a
package.json
fileAlternatively you can install a symbolic link instead of copying the entire module to your
~/my_project/node_modules
directory.For more info about this: