angularjs - How to move node_modules to a different location correctly -
i trying move node_modules different location, did deleted node_modules , moved package.json location wanted installed, ran npm install
installed node_modules wanted now, if run npm start
, server starts , alot of errors:
(index):5 http://localhost:3000/node_modules/bootstrap/dist/css/bootstrap.min.css (index):9 http://localhost:3000/node_modules/es6-shim/es6-shim.min.js (index):10 http://localhost:3000/node_modules/systemjs/dist/system-polyfills.js (index):12 http://localhost:3000/node_modules/angular2/bundles/angular2-polyfills.js (index):13 http://localhost:3000/node_modules/systemjs/dist/system.src.js (index):14 http://localhost:3000/node_modules/rxjs/bundles/rx.js (index):15 http://localhost:3000/node_modules/angular2/bundles/angular2.dev.js (index):16 http://localhost:3000/node_modules/angular2/bundles/http.dev.js (index):21 uncaught referenceerror: system not defined(anonymous function) @ (index):21
i updated index.html file use files root node_modules instead of current dir's node_modules.
what else supposed make work?
notice index.html in differnt dir node_modules
the solution follow:
- create bs-config.json file @ same dir have package.json file
put following json in bs-config.json file:
{ "server": { "basedir": "path/to/your/base/dir/where/you/have/the/index.html/of/your/app", "routes": { "/node_modules": "/path/to/node/modules/relatively/to/this/file" } } }
edit package.json file
"lite": "lite-server --c bs-config.json"
- run
npm start
, work magic :d
Comments
Post a Comment