代码之家  ›  专栏  ›  技术社区  ›  DoPeT

找不到@import文件nib.styl

  •  2
  • DoPeT  · 技术社区  · 10 年前

    为什么我会收到这个错误?我只安装了一些东西, grunt, grunt-cli, bower, nib, stylus, uglify-js jade

    DylanMBPr:Test dylanopet$ stylus -w /Users/dylanopet/Dropbox/Projects/Test watching /usr/local/lib/node_modules/stylus/lib/functions/index.styl
    Error: /Users/dylanopet/Dropbox/Projects/Test/style.styl:1
    1| @import 'nib'
    failed to locate @import file nib.styl
    at Evaluator.visitImport (/usr/local/lib/node_modules/stylus/lib/visitor/evaluator.js:882:21)
    at Evaluator.Visitor.visit (/usr/local/lib/node_modules/stylus/lib/visitor/index.js:28:40)
    at Evaluator.visit (/usr/local/lib/node_modules/stylus/lib/visitor/evaluator.js:159:18)
    at Evaluator.visitRoot (/usr/local/lib/node_modules/stylus/lib/visitor/evaluator.js:713:27)
    at Evaluator.Visitor.visit (/usr/local/lib/node_modules/stylus/lib/visitor/index.js:28:40)
    at Evaluator.visit (/usr/local/lib/node_modules/stylus/lib/visitor/evaluator.js:159:18)
    at Evaluator.evaluate (/usr/local/lib/node_modules/stylus/lib/visitor/evaluator.js:234:15)
    at Renderer.render (/usr/local/lib/node_modules/stylus/lib/renderer.js:80:26)
    at /usr/local/lib/node_modules/stylus/bin/stylus:534:15
    at fs.js:266:14
    

    这是我的错误日志:

    0 info it worked if it ends with ok
    1 verbose cli [ '/usr/local/Cellar/node/0.10.24/bin/node',
    1 verbose cli   '/usr/local/bin/npm',
    1 verbose cli   'test' ]
    2 info using npm@1.3.21
    3 info using node@v0.10.24
    4 error Error: ENOENT, open '/Users/dylanopet/Dropbox/Projects/Test/package.json'
    5 error If you need help, you may report this *entire* log,
    5 error including the npm and node versions, at:
    5 error     <http://github.com/isaacs/npm/issues>
    6 error System Darwin 13.0.0
    7 error command "/usr/local/Cellar/node/0.10.24/bin/node" "/usr/local/bin/npm" "test"
    8 error cwd /Users/dylanopet/Dropbox/Projects/Test
    9 error node -v v0.10.24
    10 error npm -v 1.3.21
    11 error path /Users/dylanopet/Dropbox/Projects/Test/package.json
    12 error code ENOENT
    13 error errno 34
    14 verbose exit [ 34, true ]
    

    任何帮助都将不胜感激!

    更新:当我添加以下。。

    stylus -u nib style.styl
    

    它编译得很好!有什么原因,为什么我不能正常观看并工作?

    1 回复  |  直到 10 年前
        1
  •  4
  •   DoPeT    10 年前

    为了解决我的问题,我不得不加上。。

    stylus -u nib -w <dir>
    

    我仍然想知道为什么我不能再简单地做手写笔了。。但这似乎暂时解决了问题。