Skip to content
This repository has been archived by the owner on Aug 15, 2018. It is now read-only.

spm build error #842

Closed
peirancao opened this issue Jun 18, 2014 · 6 comments
Closed

spm build error #842

peirancao opened this issue Jun 18, 2014 · 6 comments
Labels

Comments

@peirancao
Copy link

package.json

{
  "name": "admin-index",
  "version": "1.0.0",
  "description": "admin index module",
  "author": "peiran cao",
  "spm": {
    "dependencies": {
      "jquery": "1.7.2"
    },
    "main": "src/index"
  }
}

src/index.js

var $ = require('jquery');

exports.alert = function() {
    alert($);
}
spm build
      start: build admin-index@1.0.0
  arguments: dest = dist
  arguments: cwd = $CWD
  arguments: include = relative
  arguments: ignore =
  arguments: idleading = {{name}}/{{version}}
  arguments: install = true
      found: jquery@1.7.2
    package: analyse infomation
    package: dependencies: jquery
    package: files:
     output: files: src/index
      start: task clean
        end: task clean
      start: task build file src/index
      error: Cannot read property 'dependencies' of ~
@afc163
Copy link
Member

afc163 commented Jun 18, 2014

main 先设为 src/index.js 试试

@peirancao
Copy link
Author

加上 .js 好了 现在build为什么会在当前模块下安装依赖模块 我已经手动安装过 jquery 了 我的应用文件admin-index 在 front 文件夹 seajs 和 jquery 一些 labrary 在 lib 文件夹 这样的组织方式 请问有问题嘛?现在改的和以前的差别太大了啊 文档目前也不详细。。。

@peirancao
Copy link
Author

是不是现在的spm build不能 build 本地模块啊?

@afc163
Copy link
Member

afc163 commented Jun 18, 2014

不了解你的文件目录结构,建议按照官方推荐的目录结构进行模块开发。

@peirancao
Copy link
Author

请问官方推荐的目录结构在哪里可以看到啊?

@afc163
Copy link
Member

afc163 commented Jun 18, 2014

spm init 生成的就是。http://spmjs.io/documentation/develop-a-package

@afc163 afc163 added the bug label Jun 19, 2014
@afc163 afc163 closed this as completed Jun 24, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants