我想我能做的故宫,而不是亭子,我所做的就是做npm install angular --save
,然后包括像这样使用NPM模块失败
<script src="../node_modules/angular/angular.js"></script>
但似乎路径不正确。我创建一个临时回购来展示我的文件夹结构。
https://github.com/eldyvoon/temp/
我想我能做的故宫,而不是亭子,我所做的就是做npm install angular --save
,然后包括像这样使用NPM模块失败
<script src="../node_modules/angular/angular.js"></script>
但似乎路径不正确。我创建一个临时回购来展示我的文件夹结构。
https://github.com/eldyvoon/temp/
为了使用node_modules你不得不暴露与browsersync的direcotry。
试试这个,改变这样的gulfile.js浏览器同步一饮而尽任务:
gulp.task('browser-sync', function() {
browserSync.init(null, {
server: {
baseDir: 'app',
routes: {
'/node_modules': './node_modules'
}
}
});
});
在您的index.html你的jQuery的进口是错误的,这样做:
<script src="../node_modules/jquery/dist/jquery.min.js"></script>
希望这有帮助,让我知道如果你需要更多的信息
我没有看到'repo中的'node_modules'文件夹。请确保您已成功设置'NPM'。 – Vineet
@Vineet试图克隆并运行'npm install'。通常人们会在.gitignore中放入node_modules文件夹。 –