问题标签 [jspm]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
3 回答
1168 浏览

javascript - jspm and aurelia not working in webstorm

i've gone through Scott Allen's Hello World app, and have my Aurelia app working perfectly in visual studio.

For some reason, I'm unable to get the same result in WebStorm. My index.html body looks like:

and I'm met with a console error

Potentially unhandled rejection [3] Error loading "github:aurelia/bootstrapper@0.14.0" at http://localhost:63342/jspm_packages/github/aurelia/bootstrapper@0.14.0.js

the full error looks like:

enter image description here it looks like it's trying to grab a file boostrapper@0.14.0.js, whne that's actually a folder. Why am I unable to get the exact same code working in webstorm as in visual studio?

Here's my bootstrapper section of my config:

and running jspm -v yields

0 投票
2 回答
2430 浏览

javascript - 使用jspm加载依赖全局jQuery的脚本

是的,我已经阅读了 How do I shim a non CommonJS, non AMD package which depends on global jQuery & lodash? .

我正在尝试通过 jspm 加载 X.js,它不是一个“包”,而是一个我无法控制的旧 js 文件,它需要一个全局 jQuery 对象,并且需要像在脚本标签中一样运行。

我正在使用 System.import('app/X'); 加载它。

我尝试了各种 shim / globals 技巧来加载它,但我无法弄清楚。

如何编写 config.js 以便能够导入该 X 文件以便它看到一个全局 jQuery 对象?我是否必须将 X 设为“包”并安装它才能更好地填充它?

谢谢。

0 投票
3 回答
4870 浏览

jspm - 如何修复“jspm”不被识别为内部或外部命令、可运行程序或批处理文件

我在https://github.com/jspm/jspm-cli/wiki/Getting-Started中安装 jspm 。npm 安装 jspm -g。它运行。我称之为:jspm安装,它不运行,cmd通知“'jspm'不被识别为内部或外部命令,可运行程序或批处理文件。” 请帮帮我!

0 投票
1 回答
1006 浏览

typescript - 使用带有 typescript 和 JSPM 的 libphonenumber

https://www.npmjs.com/package/google-libphonenumber

我用 JSPM 安装了它。我试过直import 'google-libphonenumber';

我也试过 d.ts

我只是想在我的打字稿(ES6 样式模块)和 JSPM 中使用格式功能。我尝试了有和没有任何定义。

phoneUtil 和 libphonenumber 为空。

使用代码

0 投票
1 回答
47 浏览

ecmascript-6 - ES6 类在我实例化它时出错

我正在加速使用 JSPM 加载的 ES6 类。

例如:

然后我在另一个类上面导入它:

然后我使用这个类:

此行会引发错误: object does not support his method.

我应该用不同的方式来写这个吗?

0 投票
2 回答
554 浏览

reactjs - 材质 UI 不适用于 JSPM

我无法将 React 插件与 JSPM 一起使用,但 React 本身正在运行。JSPM 抛出此错误:

当我尝试在我的项目中使用 Material-UI 时会出现此问题。

0 投票
1 回答
873 浏览

javascript - 使用 jspm 运行 angular-material

我有加载 angular-material 的问题,我已经用 jspm 安装了它。通过 Systemjs。

我总是收到:

未捕获的异常:未找到: http://localhost:8080/jspm_packages/github/angular/bower-material@0.10.0/angular-material

这是我的 Systemjs 配置,由 jspm 创建

这是我的 Mainjs:

我在我的 index.html 中加载:

这有什么问题

0 投票
1 回答
304 浏览

visual-studio-cordova - JSPM + Cordova + Android

I get the following error when using JSPM CDN JavaScript, Cordova 5.1.1, TypeScript and Android:

Failed to load resource: the server responded with a status of 404 (Not Found) system@0.16.js (0,0)

enter image description here

I took the default VS2015 TypeScript Cordova project and added the following to index.html: <script src="https://jspm.io/system@0.16.js"></script>

The sample code has been tested on Windows Phone and works. I have tried Android API 19 and 22, physical devices and Genymotion(emulator). Domain Access URI has been set to *.

Any ideas on why this would be happening only on Android devices?

0 投票
1 回答
631 浏览

javascript - 如何将 ES6、AMD 和 CJS 模块与 JSPM 和系统 js 一起使用?

我正在尝试 JSPM,然后是系统 JS,因为我觉得在我的应用程序中使用 ES6 功能(例如模块)有很多价值。但是,我希望能够同时使用 CJS 和 AMD 管理我的模块。这是我试图加载和运行 CJS 模块和 ES6 模块的主应用程序文件中的代码示例:

但我得到了错误

如果我只使用一种方法,则应用程序运行时不会出错。有谁知道是否可以使用 JSPM 让 ES6、CJS 和 AMD 一起存在于同一个应用程序中?

如果做不到这一点,任何人都可以推荐一个同时支持所有三种方法的替代模块加载器库吗?

0 投票
1 回答
366 浏览

aurelia - jspm install materialize 但在 materialize.js 运行时出现 404

我在这个得到一个 404 错误:

我已经使用 jspm 安装了物化,并且包按预期存在。

但是, Dogfalo 目录中没有名为 materialize@0.96.1.js 的实际文件。

我还应该做些什么来让它发挥作用吗?