【发布时间】:2016-09-26 21:20:32
【问题描述】:
我正在尝试将我的 node_modules 移动到不同的位置,我所做的是删除 node_modules 并将 package.json 移动到我想要安装它的位置,然后我运行 npm install 将 node_modules 安装在我的位置想要,但现在,如果我运行 npm start,服务器会启动,我会收到很多错误:
(index):5 GET http://localhost:3000/node_modules/bootstrap/dist/css/bootstrap.min.css
(index):9 GET http://localhost:3000/node_modules/es6-shim/es6-shim.min.js
(index):10 GET http://localhost:3000/node_modules/systemjs/dist/system-polyfills.js
(index):12 GET http://localhost:3000/node_modules/angular2/bundles/angular2-polyfills.js
(index):13 GET http://localhost:3000/node_modules/systemjs/dist/system.src.js
(index):14 GET http://localhost:3000/node_modules/rxjs/bundles/Rx.js
(index):15 GET http://localhost:3000/node_modules/angular2/bundles/angular2.dev.js
(index):16 GET http://localhost:3000/node_modules/angular2/bundles/http.dev.js
(index):21 Uncaught ReferenceError: System is not defined(anonymous function) @ (index):21
我更新了 index.html 文件以使用根 node_modules 中的文件,而不是当前目录的 node_modules。
我还应该怎么做才能让它发挥作用?
请注意 index.html 与 node_modules 位于不同的目录中
【问题讨论】:
标签: angularjs node.js angular node-modules