Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spm 1.7.3 build 和 deploy 报错,如果升级到2.1应该怎么使用? #41

Closed
allan852 opened this issue May 22, 2013 · 3 comments
Closed

Comments

@allan852
Copy link

目前正在使用的是 spm 1.7.3,之前一直打包和部署都ok, 今天上线时,报如下错误

[WARN] http://modules.spmjs.org/config.json { [Error: ETIMEDOUT] code: 'ETIMEDOUT' }
[ERROR] Caught exception: TypeError: Cannot read property 'roots' of null

用浏览器访问 http://modules.spmjs.org/config.json ,没有结果(打不开), 翻墙也不行。

导致的问题是 js 代码不能build, 也不能deploy

之前的用法是参照(https://github.com/spmjs/spm/wiki/Hello-spm%EF%BC%9A%E4%BD%BF%E7%94%A8-spm-%E5%92%8C-SeaJS-%E5%BC%80%E5%8F%91%E4%B8%80%E4%B8%AA%E4%B8%AD%E5%9E%8B%E9%A1%B9%E7%9B%AE):

打包

命令行进入到 util/ ,运行:

spm build
SPM 会在 util/dist/ 目录创建 util.js 和 util-debug.js 两个文件。有兴趣的读者可以打开 util-debug.js 看看打包后的文件和源码有何不同。

部署

为了方便演示,我们准备把打包好的模块部署到本地。

进入 util/ ,运行命令:

spm deploy --to=../sea-modules
这时 sea-modules/ 会新增 util 模块:
sea-modules/
hellospm/
util/
0.0.1/
util.js
util-debug.js
...

现在已经不能正常使用。

两个问题:

  1. 如果保持上面的用法,应该如何修复问题?
  2. 如果升级到2.0,应该怎样操作或使用才能达到上面一样的效果?(是否有文档可以参考)

谢谢!

@allan852
Copy link
Author

尝试了新版,但是spm-build模块无法安装。

@afc163
Copy link
Member

afc163 commented May 24, 2013

你应该继续使用 spm 1.x 版本。并删掉 ~/.spm/config.json 里面 source 里的 modules.spmjs.org 配置。

@lepture @popomore

@allan852
Copy link
Author

尝试了一下,成功build 和deploy。但是会报一个 warn, 如下:

[WARN] utils not found available source!
[WARN] The source unavailable!
Deploy utils to ../sea-modules success!

谢谢! 先这样用着,到时间升级到2.x。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants