0

I got a list of node-modules, which is managed by NPM.

This is my package.json:

{
  "name": "extension-acme",
  "scripts": {
    "archive": "webpack -p && composer archive --format=zip"
  },
  "devDependencies": {
    "babel-core": "^6.23.1",
    "babel-loader": "^6.1.0",
    "babel-plugin-transform-runtime": "^6.1.2",
    "babel-preset-env": "^1.1.8",
    "babel-preset-es2015": "^6.22.0",
    "babel-runtime": "^5.8.0",
    "vue-hot-reload-api": "^1.2.0",
    "vue-html-loader": "^1.0.0",
    "vue-loader": "^8.2.0",
    "webpack": "^1.12.9"
  }
}

This works fine. But now I'd like to include this node module: https://github.com/craigh411/vue-star-rating

Now the sources of this module have to be stored in app/components/vue-star-rating.

Is it possible to change the location for this single package?

SPQRInc
  • 162
  • 4
  • 23
  • 64
  • What's stopping you from just importing the module, as the documentation suggests? Is there a particular reason you need it to be in a custom location? – Joe Clay Jan 08 '18 at 14:19

1 Answers1

1

First way

You can't install package in specific folder like app/components/vue-star-rating without node_modules folder.

You can install package like this:

npm --prefix app/components/ install <your-package>

and then installed in app/components/node_modules/<your-package>

reference:

  1. Stackoverflow
  2. npm folders

Second way

Also you can install package normally and move in specific folder

Pooya
  • 2,968
  • 2
  • 12
  • 18