Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
无法使用grunt构建AngularJS_Angularjs - Fatal编程技术网

无法使用grunt构建AngularJS

无法使用grunt构建AngularJS,angularjs,Angularjs,我是安格拉斯的新手。我正在安装AngularJS,并停留在以下步骤: 咕噜包 错误如下: Loading "Gruntfile.js" tasks...ERROR >> Error: Unable to read CDN version, are you offline or has the CDN not been properly pushed? >> at Object.module.exports (D:\angular.js\Gruntfile.js:2

我是安格拉斯的新手。我正在安装AngularJS,并停留在以下步骤:

咕噜包

错误如下:

Loading "Gruntfile.js" tasks...ERROR
>> Error: Unable to read CDN version, are you offline or has the CDN not been properly pushed?
>>     at Object.module.exports (D:\angular.js\Gruntfile.js:21:11)
>>     at loadTask (D:\angular.js\node_modules\grunt\lib\grunt\task.js:325:10)
>>     at Task.task.init (D:\angular.js\node_modules\grunt\lib\grunt\task.js:437:5)
>>     at Object.grunt.tasks (D:\angular.js\node_modules\grunt\lib\grunt.js:120:8)
>>     at Object.module.exports [as cli] (D:\angular.js\node_modules\grunt\lib\grunt\cli.js:38:9)
>>     at Object.<anonymous> (C:\Users\rnaguban\AppData\Roaming\npm\node_modules\grunt-cli\bin\grunt:44:20)
>>     at Module._compile (module.js:409:26)
>>     at Object.Module._extensions..js (module.js:416:10)
>>     at Module.load (module.js:343:32)
>>     at Function.Module._load (module.js:300:12)
>>     at Function.Module.runMain (module.js:441:10)
>>     at startup (node.js:139:18)
>>     at node.js:968:3

Running tasks: package
Warning: Task "package" not found. Use --force to continue.

Aborted due to warnings.
正在加载“Gruntfile.js”任务…错误
>>错误:无法读取CDN版本,您是脱机还是未正确推送CDN?
>>在Object.module.exports(D:\angular.js\grunfile.js:21:11)
>>在loadTask(D:\angular.js\node\u modules\grunt\lib\grunt\task.js:325:10)
>>在Task.Task.init(D:\angular.js\node\u modules\grunt\lib\grunt\Task.js:437:5)
>>在Object.grunt.tasks(D:\angular.js\node\u modules\grunt\lib\grunt.js:120:8)
>>在Object.module.exports[as cli](D:\angular.js\node\u modules\grunt\lib\grunt\cli.js:38:9)
>>反对。(C:\Users\rnaguban\AppData\Roaming\npm\node\u modules\grunt cli\bin\grunt:44:20)
>>在模块处编译(Module.js:409:26)
>>在Object.Module.\u extensions..js(Module.js:416:10)
>>在Module.load(Module.js:343:32)
>>在Function.Module.\u加载(Module.js:300:12)
>>位于Function.Module.runMain(Module.js:441:10)
>>启动时(node.js:139:18)
>>在node.js:968:3
正在运行的任务:包
警告:找不到任务“包”。使用--force继续。
由于警告而中止。
任何投入都会有帮助

谢谢
拉维

我也遇到过这样的问题:

CDN version (remote): No version found. Current version (remote): v1.5.7 Loading "Gruntfile.js" tasks...ERROR
>> Error: Unable to read CDN version, are you offline or has the CDN not been properly pushed? Warning: Task "package" not found. Use
--force to continue.

Aborted due to warnings.
我检查了angular的源代码,在'Gruntfile.js'中找到,第20行它抛出了错误

无法读取CDN版本,您是脱机还是未正确推送CDN

,因此请注释此代码以解决您的问题

  //if (versionInfo.cdnVersion == null) {
  //  throw new Error('Unable to read CDN version, are you offline or has the CDN not been properly pushed?');
  //}
这可以使建筑成功


我也遇到了这样的问题:

CDN version (remote): No version found. Current version (remote): v1.5.7 Loading "Gruntfile.js" tasks...ERROR
>> Error: Unable to read CDN version, are you offline or has the CDN not been properly pushed? Warning: Task "package" not found. Use
--force to continue.

Aborted due to warnings.
我检查了angular的源代码,在'Gruntfile.js'中找到,第20行它抛出了错误

无法读取CDN版本,您是脱机还是未正确推送CDN

,因此请注释此代码以解决您的问题

  //if (versionInfo.cdnVersion == null) {
  //  throw new Error('Unable to read CDN version, are you offline or has the CDN not been properly pushed?');
  //}
这可以使建筑成功


您应该首先设置环境变量
NG1\u BUILD\u NO\u REMOTE\u VERSION\u请求
。例如,在Windows中:

set NG1_BUILD_NO_REMOTE_VERSION_REQUESTS=1

您应该首先设置环境变量NG1\u BUILD\u NO\u REMOTE\u VERSION\u REQUESTS。例如,在Windows中:

set NG1_BUILD_NO_REMOTE_VERSION_REQUESTS=1

你上网了吗?“无法阅读CDN版本,您是否脱机”您可能不应该依赖CDN进行本地开发,也不应该找到
任务“包”
@Raghuveer我连接到internet您可能不记得切换到正确的分支…这是我忘记的。您连接到internet了吗?“无法阅读CDN版本,您是否脱机”您可能不应该依赖CDN进行本地开发,也不应该找到
任务“包”
@Raghuveer我已连接到Internet您可能不记得切换到正确的分支…这是我忘记的。