任务" webpack:debug"失败:无法解决' file'或者'目录'

时间:2015-09-02 07:07:20

标签: javascript node.js gruntjs npm webpack

我正在尝试设置Sir Trevor 0.5.0。在编译开发(npm run dev)时,我收到以下错误(即使目录src明显存在):

> sir-trevor@0.5.0 dev /Users/daniel/Downloads/SirTrevTest/bower_components/sir-trevor-js
> grunt dev watch

Running "sass:dist" (sass) task

Running "sass:test" (sass) task

Running "webpack:debug" (webpack) task
Version: webpack 1.12.0     
              Asset     Size  Chunks             Chunk Names
sir-trevor.debug.js  1.95 kB       0  [emitted]  main

ERROR in ./index.js
Module not found: Error: Cannot resolve 'file' or 'directory' ./src in /Users/daniel/Downloads/SirTrevTest/bower_components/sir-trevor-js
 @ ./index.js 1:17-33
Warning: Task "webpack:debug" failed. Use --force to continue.

Aborted due to warnings.

npm ERR! Darwin 14.1.0
npm ERR! argv "node" "/usr/local/bin/npm" "run" "dev"
npm ERR! node v0.12.7
npm ERR! npm  v2.11.3
npm ERR! code ELIFECYCLE
npm ERR! sir-trevor@0.5.0 dev: `grunt dev watch`
npm ERR! Exit status 3
npm ERR! 
npm ERR! Failed at the sir-trevor@0.5.0 dev script 'grunt dev watch'.
npm ERR! This is most likely a problem with the sir-trevor package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     grunt dev watch
npm ERR! You can get their info via:
npm ERR!     npm owner ls sir-trevor
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/daniel/Downloads/SirTrevTest/bower_components/sir-trevor-js/npm-debug.log

index.js看起来像这样:

module.exports = require('./src');

webpack.config.js看起来像这样:

module.exports = {
    module: {
        loaders: [
            { test: /\.css$/, loader: "style!css" },
            { test: /\.jade$/, loader: "jade?self" }
        ]
    },
    node: {
        fs: "empty"
    }
}

最后,npm-debug.log看起来像这样:

0 info it worked if it ends with ok
1 verbose cli [ 'node', '/usr/local/bin/npm', 'run', 'dev' ]
2 info using npm@2.11.3
3 info using node@v0.12.7
4 verbose run-script [ 'predev', 'dev', 'postdev' ]
5 info predev sir-trevor@0.5.0
6 info dev sir-trevor@0.5.0
7 verbose unsafe-perm in lifecycle true
8 info sir-trevor@0.5.0 Failed to exec dev script
9 verbose stack Error: sir-trevor@0.5.0 dev: `grunt dev watch`
9 verbose stack Exit status 3
9 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:213:16)
9 verbose stack     at EventEmitter.emit (events.js:110:17)
9 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:24:14)
9 verbose stack     at ChildProcess.emit (events.js:110:17)
9 verbose stack     at maybeClose (child_process.js:1015:16)
9 verbose stack     at Process.ChildProcess._handle.onexit (child_process.js:1087:5)
10 verbose pkgid sir-trevor@0.5.0
11 verbose cwd /Users/daniel/Downloads/SirTrevTest/bower_components/sir-trevor-js
12 error Darwin 14.1.0
13 error argv "node" "/usr/local/bin/npm" "run" "dev"
14 error node v0.12.7
15 error npm  v2.11.3
16 error code ELIFECYCLE
17 error sir-trevor@0.5.0 dev: `grunt dev watch`
17 error Exit status 3
18 error Failed at the sir-trevor@0.5.0 dev script 'grunt dev watch'.
18 error This is most likely a problem with the sir-trevor package,
18 error not with npm itself.
18 error Tell the author that this fails on your system:
18 error     grunt dev watch
18 error You can get their info via:
18 error     npm owner ls sir-trevor
18 error There is likely additional logging output above.
19 verbose exit [ 1, true ]

可能导致此错误的原因是什么?

0 个答案:

没有答案