Angularjs 为什么可以';吞咽主要npm文件参见角旋转套件?
我正试图从bower迁移出去,它的作用是获取项目所需的前端供应商包。目前,我正在使用主bower文件库获取gulpfile.js中bower.json中“dependencies”下列出的所有库。我正在尝试使用gulp主npm文件作为替换 为了测试这一点,我从bower.json中删除了angular spinkit,并使用npm install--save。这在package.json中创建了一个新字段“dependencies”,并在其中放置了相同版本的angular spinkit。此外,该库现在显示在node_模块中 在gulpfile.js中,我试图测试这一更改是否可行,但到目前为止还没有Angularjs 为什么可以';吞咽主要npm文件参见角旋转套件?,angularjs,node.js,npm,gulp,bower,Angularjs,Node.js,Npm,Gulp,Bower,我正试图从bower迁移出去,它的作用是获取项目所需的前端供应商包。目前,我正在使用主bower文件库获取gulpfile.js中bower.json中“dependencies”下列出的所有库。我正在尝试使用gulp主npm文件作为替换 为了测试这一点,我从bower.json中删除了angular spinkit,并使用npm install--save。这在package.json中创建了一个新字段“dependencies”,并在其中放置了相同版本的angular spinkit。此外,
gulp.task("build-vendor-src", function () {
var bower = gulp.src(
mainBowerFiles("**/*.js", {
"debugging": false,
"overrides": {
"angular-mocks": {ignore: true}
}
}))
.pipe(devOnly(sourcemaps.init()))
.pipe(uglify())
.pipe(concat(buildProps.masterVendorJS))
.pipe(devOnly(sourcemaps.write(".")))
.pipe(gulp.dest(buildProps.distFolder));
var npm = gulp.src(
mainNPMFiles(), {base:'./'})
.pipe(devOnly(sourcemaps.init()))
.pipe(uglify())
.pipe(concat(buildProps.masterVendorJS))
.pipe(devOnly(sourcemaps.write(".")))
.pipe(gulp.dest(buildProps.distFolder));
return merge(bower, npm);
});
我在很多地方都会遇到这样的错误:
Error: [$injector:modulerr] Failed to instantiate module app due to:
[INFO] Error: [$injector:modulerr] Failed to instantiate module angular-spinkit due to:
[INFO] Error: [$injector:nomod] Module 'angular-spinkit' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.
[INFO] http://errors.angularjs.org/1.5.11/$injector/nomod?p0=angular-spinkit
[INFO] at http://localhost:9877dist/vendor.min.js:1:374
[INFO] at http://localhost:9877dist/vendor.min.js:1:10245
[INFO] at n (http://localhost:9877dist/vendor.min.js:1:9726)
[INFO] at http://localhost:9877dist/vendor.min.js:1:10030
[INFO] at http://localhost:9877dist/vendor.min.js:1:17679
[INFO] at r (http://localhost:9877dist/vendor.min.js:1:825)
[INFO] at h (http://localhost:9877dist/vendor.min.js:1:17527)
[INFO] at http://localhost:9877dist/vendor.min.js:1:17696
[INFO] at r (http://localhost:9877dist/vendor.min.js:1:825)
[INFO] at h (http://localhost:9877dist/vendor.min.js:1:17527)
你把这个添加到你的模块了吗?@AvneshShakya我们假设我没有。我是怎么知道的?@AvneshShakya如果你想问我是否将库作为依赖项放在angularJS本身中,比如在var myapp=angular.module('myapp',['angular-spinkit'),那么是的。